simple-photo-gallery
simple-photo-gallery copied to clipboard
Add image hash for files gallery to replace use of mtime
This is a partial solution to #117. I implemented this for the files gallery but not the other variants. This is for your consideration.
- a sha1 hash is generated for each image and saved in the image_data file
- if hash is present in image_data file then that is used to detect file change
- if hash is not present in image_data file (older version), then the mtime is used to detect file change (old behavior). this should allow it to remain backward compatible with previously generated image_data files
- a new configuration item
force_description_reuse
is added that if true, will reuse descriptions even if it appears the file has changed. this can be used in situations like mine where I want to preserve descriptions for photos where the mtime changed for some reason but the file contents are the same
I did limited testing with my own test case.
I tried running the unit tests. As far as I can tell they all passed but I am not sure I ran them all, or ran them correctly.