TomoyukiAota / photo-location-map

Display the locations where photos were taken on a map. 📷 🗺️
https://tomoyukiaota.github.io/photo-location-map/
MIT License
49 stars 3 forks source link

Feature: cache indexing #543

Open starnutoditopo opened 1 year ago

starnutoditopo commented 1 year ago

Version of Photo Location Map

1.9.0

OS

Windows

OS Version

Windows 11

Description

It would be handy if the location information was cached (eg. in an hidden .PhotoLocationMapCache file per folder), to speed-up the process in case of a huge quantity of files.

Use case: each time, it takes about 6 hours to retrieve the location information by scanning all my photos... image

TomoyukiAota commented 1 year ago

Hello @starnutoditopo

I understand the idea that having cache speeds up loading the files, but implementing it does not seem to be a easy task... I'll think about it if I have time.

BTW, the number of your photos is enormous. Does this app still work well?

Also, I have 13294 files as of this writing and it took 2 minutes to load, so I wonder taking 6 hours to load your 271070 files might be too much compared to my PC's case. (This depends on the PC's CPU and disk read speed, of course.) i.e. If I were to load 271070 files, it should take approximately 40 minutes. I'm just wondering.

starnutoditopo commented 1 year ago

Hi, @TomoyukiAota !

About the timing, I think my problem is the disk: it's a USB drive. Memory and CPU seem not to be that stressed, during the scanning process. I must say that I didn't really see the map rendering, after the folder were scanned, because the application seemed to hang.

About the caching, if it requires too much effort, an alternative would be to fire an event (so that an external process could handle it) and provide some way to load cached data. This could be implemented, for example by calling an URL, if it is specified in some setting, performing a POST request with some data in the body like a json with file full path, latitude, longitude, or whatever other information. A "Load data from file" command should be provided, on the other way, to retrieve saved data from some file, without having to scan anything.

I was actually trying to put my hands in the code, but I first need to be able to develop in a docker container with vsCode (I tried to add this kind of support in a fork, https://github.com/starnutoditopo/photo-location-map , but it doesn't work properly , yet)