Add inverse mappings for exif tags.

A nicer solution would be to switch to an enum with the right values, but this is the quick win.
This commit is contained in:
Melon Mouse 2022-09-16 10:48:37 +02:00 committed by GitHub
parent 1d1a22bde3
commit 6d9d4af192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,6 +293,11 @@ TAGS = {
}
"""Maps EXIF tags to tag names."""
TAG_CODES = {
# possibly incomplete
tag_name: tag_code for tag_code, tag_name in TAGS.items()
}
"""Maps tag names to EXIF tags."""
GPSTAGS = {
0: "GPSVersionID",
@ -329,3 +334,6 @@ GPSTAGS = {
31: "GPSHPositioningError",
}
"""Maps EXIF GPS tags to tag names."""
GPS_CODES = {gps_name: gps_code for gps_code, gps_name in GPSTAGS.items()}
"""Maps tag names to EXIF GPS tags."""