jmathai / elodie

An EXIF-based photo assistant, organizer and workflow automation tool.
https://bit.ly/introducing-elodie
Apache License 2.0
1.27k stars 139 forks source link

Question/Possible PEBKAC #391

Closed angrycuban13 closed 3 years ago

angrycuban13 commented 3 years ago

Hi,

I've been using Elodie for a few weeks now. I recently organized my whole iCloud library and tagged every photo. Very happy with it so far.

Now, I'm running into an issue that I don't know if it is PEBKAC or just by design.

I download photos from an online source using third party tool and after it downloads the directory structure looks as such:

├───2018
│   ├───2018-08-07
├───2019
│   ├───2019-01-02

After downloading the photos I run the import with Elodie as such:

.\elodie.py--debug --destination="D:\Pictures\Path\To\Destination" "D:\Pictures\Path\To\Source"

It all goes well and it moves it where I want it to be moved and since all the photos are missing the GPS data, they all get placed as follows:

├───2018-08-Aug
│   └───Unknown Location
├───2018-09-Sep
│   └───Unknown Location

Now after moving it, I update the location as follows:

.\elodie.py update --debug --location="City, State" "D:\Pictures\Path\To\Destination"

Everything gets moved as follows

D:\Pictures\Path\To\Destination\Default-Date-Format\Unknown Location\<filename>.jpg -> D:\Pictures\Path\To\Destination\Default-Date-Format\City\<filename>.jpg

After running that command the file structure looks as follow:

├───2018-08-Aug
│   └───City

Now the problem I'm running into is that if I run the import again, it will re-import every picture that doesn't have the GPS data (which is all of them), so it ends up looking like this:

├───2018-08-Aug
│   └───Unknown Location
│   └───City

This creates the issue where I can't quite automate everything like I had intended to do. Am I doing something wrong or this is just sort of by design? I figured that since Elodie keeps a hash of every photo, it would recognize <filename>.jpg>'s hash even though it had no GPS data. Unless the file hash changes once you modify the EXIF data? Excuse my ignorance if I'm wrong.

jmathai commented 3 years ago

Unless the file hash changes once you modify the EXIF data?

You diagnosed it correctly. Is there a reason you're re-importing photos that have already been imported once? You can use the --trash option to move the source files to the trash once they've been imported.

If you're not able to use --trash or for some reason you're always going to re-import photos then you can look at adding the location data to the photo before importing (using a separate tool like exiftool) and avoid using update at all.

angrycuban13 commented 3 years ago

So the reason why I "re-import" is because of the way the tool downloads the photos. It downloads a folder for the year 2018 and then a folder for the day 2018-08-07 and whatever photos were taken that day. If it doesn't detect the photos in these folders then it re-downloads them as it detects them as "missing".

I like your idea of using exiftool directly to update the location and just import them with Elodie afterwards so the hash matches.

Another question for you, how did you get the verify to email you on bit rot?

jmathai commented 3 years ago

Here are the commands I use to update the geolocation data in a photo.

# Update the lat/lon of a photo
# A negative latitude is South
# A negative longitude is West
exiftool -EXIF:GPSLongitude="-84.683333"  -EXIF:GPSLatitude="10.502117" \
    -GPSLongitudeRef="West" -GPSLatitudeRef="North" \
    /path/to/photo.jpg

The verify command returns an exit code of 0 on success. You can use that in a shell script to only send an email when it fails. Here's an example for a shell script.