haltakov / simple-photo-gallery

Beautiful and simple photo galleries that help you tell your story. Free and open-source.
https://haltakov.net/simple-photo-gallery
MIT License
194 stars 51 forks source link

Use file hash instead of modification time to overwrite photo data in json file #117

Open kroesche opened 2 years ago

kroesche commented 2 years ago

First, thank you for this. I needed a photo gallery and stumbled across this after seeing a lot of overcomplicated and bloated solutions. This one is perfect.

After creating a gallery and adding captions to the json file, i did some file operations including some copies and some git operations on my photos. I am not sure what caused it but at some point the mtime changed on my photos and now when I regenerate my gallery it erases all my captions in the json file.

First, is there a way to regenerate and not have this happen (keep existing captions)?

Second, I suggest a better way to track whether the photo changed is to save hash of photo files and compare that instead of modification date.

Thank you.

kroesche commented 4 months ago

I am now working on this issue on branch feature/filehash.