jordenc / image.grabber

Image Grabber for Homey
0 stars 4 forks source link

Only JPG images are grabbed, not GIF or PNG #7

Open Veldkornet opened 6 years ago

Veldkornet commented 6 years ago

While testing the speed of the images to Telegram, I noticed that Images that were PNG or GIF were not sent.

I checked the documentation here https://apps.developer.athom.com/Image.html and I found that the code is missing.

I see that you set it directly to JPG: let myImage = new Homey.Image('jpg');

Is this on purpose, ie, Telegram only accepts jpg? OR am I reading this wrong?

Where as you should use: let myImage = new Homey.Image(format);

and then use getFormat to get the format:

getFormat() → {String}
Get the format

Returns:
Type:  String
format Either png, jpg or gif
jordenc commented 6 years ago

I think getFormat only the format that you set, using "new Homey.image". So that won't work.

I think I would have to make 3 separate functions for JPG/PNG/GIF or perhaps just not set it at all. (https://apps.developer.athom.com/tutorial-Flow-Tokens-Image.html gets the image from the local storage, but doesn't set the format at all)

Haven't got time to test currently though.