From 510de539bd8df525755a92ea4c20ec0bf1de88db Mon Sep 17 00:00:00 2001 From: Peter Stensson Date: Mon, 8 Mar 2021 13:44:04 +0100 Subject: [PATCH] Add support for SensitivityType tag As per EXIF specification, SensitivityType tag should be recorded when PhotographicSensitivity(AKA ISOSpeedRatings) is recorded. --- libexif/exif-entry.c | 12 ++++++++++++ libexif/exif-tag.c | 7 +++++++ libexif/exif-tag.h | 1 + 3 files changed, 20 insertions(+) diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c index 822a6416..d08b2dbb 100644 --- a/libexif/exif-entry.c +++ b/libexif/exif-entry.c @@ -778,6 +778,16 @@ static const struct { {8, {N_("Landscape mode (for landscape photos with the background " "in focus)"), N_("Landscape"), NULL}}, {0, {NULL}}}}, + { EXIF_TAG_SENSITIVITY_TYPE, + { {0, {N_("Unknown"), NULL}}, + {1, {N_("Standard output sensitivity (SOS)"), NULL}}, + {2, {N_("Recommended exposure index (REI)"), NULL}}, + {3, {N_("ISO speed"), NULL}}, + {4, {N_("Standard output sensitivity (SOS) and recommended exposure index (REI)"), NULL}}, + {5, {N_("Standard output sensitivity (SOS) and ISO speed"), NULL}}, + {6, {N_("Recommended exposure index (REI) and ISO speed"), NULL}}, + {7, {N_("Standard output sensitivity (SOS) and recommended exposure index (REI) and ISO speed"), NULL}}, + {0, {NULL}}}}, { EXIF_TAG_FLASH, { {0x0000, {N_("Flash did not fire"), N_("No flash"), NULL}}, {0x0001, {N_("Flash fired"), N_("Flash"), N_("Yes"), NULL}}, @@ -1295,6 +1305,7 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) case EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT: case EXIF_TAG_RESOLUTION_UNIT: case EXIF_TAG_EXPOSURE_PROGRAM: + case EXIF_TAG_SENSITIVITY_TYPE: case EXIF_TAG_FLASH: case EXIF_TAG_SUBJECT_DISTANCE_RANGE: case EXIF_TAG_COLOR_SPACE: @@ -1450,6 +1461,7 @@ exif_entry_initialize (ExifEntry *e, ExifTag tag) case EXIF_TAG_SUBJECT_DISTANCE_RANGE: case EXIF_TAG_FLASH: case EXIF_TAG_ISO_SPEED_RATINGS: + case EXIF_TAG_SENSITIVITY_TYPE: /* SHORT, 1 component, default 0 */ case EXIF_TAG_IMAGE_WIDTH: diff --git a/libexif/exif-tag.c b/libexif/exif-tag.c index 30e09179..d4bb2b3d 100644 --- a/libexif/exif-tag.c +++ b/libexif/exif-tag.c @@ -524,6 +524,13 @@ static const struct TagEntry { {EXIF_TAG_TIME_ZONE_OFFSET, "TimeZoneOffset", N_("Time Zone Offset"), N_("Encodes time zone of camera clock relative to GMT."), ESL_UNKNOWN}, + {EXIF_TAG_SENSITIVITY_TYPE, "SensitivityType", N_("Sensitivity Type"), + N_("The SensitivityType tag indicates which one of the parameters of " + "ISO12232 is the PhotographicSensitivity tag. Although it is an optional " + "tag, it should be recorded when a PhotographicSensitivity tag is recorded. " + "Value = 4, 5, 6, or 7 may be used in case that the values of plural parameters " + "are the same."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_EXIF_VERSION, "ExifVersion", N_("Exif Version"), N_("The version of this standard supported. Nonexistence of this " "field is taken to mean nonconformance to the standard."), diff --git a/libexif/exif-tag.h b/libexif/exif-tag.h index c5518027..225f2a21 100644 --- a/libexif/exif-tag.h +++ b/libexif/exif-tag.h @@ -90,6 +90,7 @@ typedef enum { EXIF_TAG_ISO_SPEED_RATINGS = 0x8827, EXIF_TAG_OECF = 0x8828, EXIF_TAG_TIME_ZONE_OFFSET = 0x882a, + EXIF_TAG_SENSITIVITY_TYPE = 0x8830, EXIF_TAG_EXIF_VERSION = 0x9000, EXIF_TAG_DATE_TIME_ORIGINAL = 0x9003, EXIF_TAG_DATE_TIME_DIGITIZED = 0x9004,