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

Add an option to fix the image create time #65

Open
RKrahl opened this issue Nov 19, 2024 · 1 comment
Open

Add an option to fix the image create time #65

RKrahl opened this issue Nov 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@RKrahl
Copy link
Owner

RKrahl commented Nov 19, 2024

The image create time recorded in the exif data is all too often wrong. We should have an option to fix that. It should be fixed in the index only, not in the image file, since we want to stick with the principle to access the image files read only.

The most common causes of faulty create time in the image file include:

  • camera clock being set wrong during taking the image,
  • camera set to wrong time zone or wrong daylight saving time setting, which may be considered a special case of the previous bullet.

We might implement this adding some --fix-date command line option, taking an offset as argument, to the create subcommand of the CLI and/or adding a new fix subcommand to the CLI.

We probably should implement #7 first and this one on top of it.

@RKrahl RKrahl added the enhancement New feature or request label Nov 19, 2024
@RKrahl RKrahl added this to the 0.11 milestone Nov 19, 2024
@RKrahl RKrahl removed this from the 0.11 milestone Dec 29, 2024
@RKrahl
Copy link
Owner Author

RKrahl commented Dec 30, 2024

Not sure about this one: it turns out that once we have implemented #7, these kind of issues can be relatively easy fixed using the photoidx API in an interactive Python shell. It might be as easy as:

>>> import datetime
>>> import photoidx.index
>>> tz = datetime.timezone(datetime.timedelta(hours=-6))
>>> with photoidx.index.Index(idxfile=".") as idx:
...     for i in idx:
...         i.createDate = i.createDate.astimezone(tz)
...     idx.write()

On the other hand, given the variety of possible errors that may occur in practice, it might be challenging to come up with a CLI suitable to cover all cases in an efficient way. I tend to to give that interactive Python shell a try as a user interface and wait and see how it performs in practice.

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

No branches or pull requests

1 participant