mrworf / photoframe

Software to pull random photos from Google Photos and show them, like a photo frame
GNU General Public License v3.0
222 stars 38 forks source link

How about displaying the current date, time and weather. #159

Closed adnx2h closed 3 years ago

adnx2h commented 4 years ago

Congratulations for such a great project, is more complex than i initially imagined.

I tried to add a widget for displaying the clock and date, im talking about the "conky" project. but seems that it requires a X system to run.

Ill keep trying on my own to understand how things are displayed in the screen and if i success ill publish it.

mrworf commented 4 years ago

Thanks 😄

Photoframe draws directly to the framebuffer ( /dev/fb0 ) using mostly imagemagick as the renderer, which is why it's a bit complicated (saves memory though).

The render pipeline isn't too bad though (but I'm biased 😉 ) ... if you look at https://github.com/mrworf/photoframe/blob/1fc3d7cdc81c6486aebc5c56eb7d3346b0ed54fc/modules/slideshow.py#L223 this is where the image is processed before shown. Ideally, any addition you make here should happen after the self.cacheMgr.setCachedImage() call and before the self._colormatch() since the cache should be of an untarnished image and anyone using a color sensor would like to have the overlay match.

Looking at the code now, you'd want to have your items inserted right before the return for that function, this way you will not be affected by the reframing of the image (which would probably mess you up a bit).

The processing works in such a way that function which touch the image get the filename sent as argument (to which changes are applied) and then returns the new filename for the next processor to work on.

Just make sure to erase the original filename or re-use it and delete any temporary files. There's no clean up done to anything a processor does, so to avoid filling the SD card (or ram), please make sure you ALWAYS delete any temporary content. The filename given is also considered fair game if you return a new filename to use.

And on that note, if anything goes wrong, try to recover gracefully, even if it means you simply return the file given to you 😄 (look at helper.makeFullframe for ideas)

Good luck! Looking forward to anything you come up with.