sibbl / hass-lovelace-kindle-screensaver

This tool generates a png from a Home Assistant Lovelace view, which can be displayed on a Kindle device which has the Online Screensaver plugin installed.
MIT License
311 stars 71 forks source link

Feature request: output to jpg file format #109

Closed akvaran closed 3 months ago

akvaran commented 4 months ago

Hi there! This is a great add on, thanks for build and maintenance. Iā€™m trying to use an inkplate in lieu of a kindle, which only accepts jpg file format. Any chance you could build option to change image output to jpg? Also, is there a way to specify a full URL for the image rather than a port? (Inkplate programming via Ardunio IDE seems to only want an address ending in .jpg rather than an open port). Thanks heaps!

sibbl commented 4 months ago

Hi, allowing an output type jpeg sounds like a good idea, I'll keep that on the list!

I'm not sure about including the file extension in the path, however. It sounds like an easy way the library took to detect the file type - so it's more an active decision on their side which we shouldn't fix on our side.

If I'm not mistaken, it should be possible for you to work with Image::drawPngFromWeb after including the ImagePNG.h, see their code: https://github.com/SolderedElectronics/Inkplate-Arduino-library/blob/aba019c9d2e67bc7e4afb9862be97cf22bd4b430/src/include/ImagePNG.cpp#L208

Maybe this also already solves your specific case?

LaTrappe commented 4 months ago

Hi Sibbl. Just discovered your screensaver. Its exactly what i was looking for as I did collect an old Kodak digital photo frame from the 2nd hand store. Unfortunately it would only accept JPG's so I would be highly interested in this feature request as well. Many thanks in advance!

nbarrientos commented 3 months ago

+1

LaTrappe commented 3 months ago

I adapted the code so its exporting to JPG. Does what it needs to do, although this is not the most pretty solution. See my fork

sibbl commented 3 months ago

@LaTrappe thanks for that reference! Do you think you'd find the time to make the file extension configurable? I think a lot of people would be interested in such a pull request šŸ‘ I currently unfortunately don't find the time myself, but would be happy to review it and support you.

nbarrientos commented 3 months ago

Yeah, @LaTrappe, it'd be lovely if you could submit your patch making the file format switchable via a config option (environment variable) :heart:

LaTrappe commented 3 months ago

@LaTrappe thanks for that reference! Do you think you'd find the time to make the file extension configurable? I think a lot of people would be interested in such a pull request šŸ‘ I currently unfortunately don't find the time myself, but would be happy to review it and support you.

Im afraid not, I`m not a software developer. Just a script kiddy. See this as a proof of concept.

nbarrientos commented 3 months ago

MR available for discussion.