danielkucera / epaper-station

58 stars 8 forks source link

Bitmap files handling improvements #15

Closed fk0815 closed 1 year ago

fk0815 commented 1 year ago

This includes fixes for file path when the file paths are not the default. Cleanup support for temporary files. Preparation of temporary files when bmp file is changed.

danielkucera commented 1 year ago

Hi @fk0815 , thank you for the PR. I don't like adding more dependencies with questionable cross-portability. Would it be possible to implement the watcher as a thread with loop checking the files each N seconds?

fk0815 commented 1 year ago

Hi @fk0815 , thank you for the PR. I don't like adding more dependencies with questionable cross-portability. Would it be possible to implement the watcher as a thread with loop checking the files each N seconds?

Hello, I added that. The image files modification times are scanned every second and when there is a modification, a worker thread of spawned to process it. Unfortunately the bmp2grays functions are using global variables, by that only one worker can be used as this is not a thread safe implementation. With some cleanup a parallel processing would be possible.