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

piexif.ExifIFD["DateTimeOriginal"] should be also supported #139

Open
step135 opened this issue Feb 22, 2023 · 2 comments
Open

piexif.ExifIFD["DateTimeOriginal"] should be also supported #139

step135 opened this issue Feb 22, 2023 · 2 comments

Comments

@step135
Copy link

step135 commented Feb 22, 2023

There is a need to get EXIF data according to value of a variable, but it is not currently achievable:

a = "DateTimeOriginal"
piexif.ExifIFD[a]

It fails!

a = "DateTimeOriginal"
piexif.ExifIFD.get(a)

It also fails!

@RezaOptimotive
Copy link

here you can see the full list of available tags.

For your case however, you can do:

exif_dict = piexif.load("foo.jpg")
datetime_original = exif_dict["Exif"][piexif.ExifIFD.DateTimeOriginal]

@Dobatymo
Copy link

@step135 you can use getattr(piexif.ExifIFD, "DateTimeOriginal")

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

3 participants