Open Veldkornet opened 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.
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: