Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamps are (presumably) based on file names and not metadata, so photos are out of order #140

Open
ghost opened this issue Feb 21, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 21, 2020

I just spun up a docker container with OwnPhotos and had it read a directory that holds all of my photos. The problem is, the photos that had timestamps didn't seem to be ordered in any particular way, and some were marked for the year 6423! I looked at the file name, and it had 6423 in it, so I'm assuming the app is basing the file date on the photo name rather than reading the photo's metadata and extracting the date from that.

@derneuere
Copy link

derneuere commented Nov 14, 2020

It tries to find a timestamp in the filename after reading the exif Data and failing to do so:

ownphotos/api/models.py

Lines 420 to 433 in be71882

if not self.exif_timestamp:
try:
basename_without_extension = os.path.basename(self.image_path)
self.exif_timestamp = dateparser.parse(
basename_without_extension, ignoretz=True,
fuzzy=True).replace(tzinfo=pytz.utc)
util.logger.info(
'determined date from filname for image {} - {}'.format(
self.image_path,
self.exif_timestamp.strftime(date_format)))
except BaseException:
util.logger.warning(
"Failed to determine date from filename for image %s" %
self.image_path)

What would be a more expected result? Maybe making it optional with a checkbox before scanning the folders?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant