diff options
Diffstat (limited to 'src/libexif/exif-tag.c')
-rw-r--r-- | src/libexif/exif-tag.c | 412 |
1 files changed, 296 insertions, 116 deletions
diff --git a/src/libexif/exif-tag.c b/src/libexif/exif-tag.c index 7781611..7a8c7e1 100644 --- a/src/libexif/exif-tag.c +++ b/src/libexif/exif-tag.c @@ -1,6 +1,6 @@ /* exif-tag.c * - * Copyright © 2001 Lutz Müller <lutz@users.sourceforge.net> + * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,22 +26,28 @@ #include <stdlib.h> #include <string.h> -typedef enum { - ESL_MANDATORY = 1, /* Mandatory */ - ESL_CMANDATORY = 2, /* Conditionally mandatory */ - ESL_OPTIONAL = 3, /* Optional */ - ESL_NOT_RECORDED = 4 /* Not recorded */ -} ExifSL; /* Exif Support Level */ +#define ESL_NNNN { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED } +#define ESL_OOOO { EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL } +#define ESL_MMMN { EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_NOT_RECORDED } +#define ESL_MMMM { EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY } +#define ESL_OMON { EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_NOT_RECORDED } +#define ESL_NNOO { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_OPTIONAL, EXIF_SUPPORT_LEVEL_OPTIONAL } +#define ESL_NNMN { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_NOT_RECORDED } +#define ESL_NNMM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY, EXIF_SUPPORT_LEVEL_MANDATORY } +#define ESL_NNNM { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_MANDATORY } +#define ESL_NNNO { EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_NOT_RECORDED, EXIF_SUPPORT_LEVEL_OPTIONAL } +#define ESL_GPS { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN } -static struct { +static const struct { ExifTag tag; const char *name; const char *title; const char *description; - ExifSL esl_0[4], esl_1[4], esl_exif[4], esl_gps[4]; + ExifSupportLevel esl[EXIF_IFD_COUNT][4]; } ExifTagTable[] = { +#ifndef NO_VERBOSE_TAG_STRINGS {EXIF_TAG_NEW_SUBFILE_TYPE, "NewSubfileType", - "New Subfile Type", N_("A general indication of the kind of data " + N_("New Subfile Type"), N_("A general indication of the kind of data " "contained in this subfile.")}, {EXIF_TAG_INTEROPERABILITY_INDEX, "InteroperabilityIndex", "InteroperabilityIndex", @@ -49,35 +55,37 @@ static struct { "Use \"R98\" for stating ExifR98 Rules. Four bytes used " "including the termination code (NULL). see the separate " "volume of Recommended Exif Interoperability Rules (ExifR98) " - "for other tags used for ExifR98.")}, + "for other tags used for ExifR98."), + { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO } }, {EXIF_TAG_INTEROPERABILITY_VERSION, "InteroperabilityVersion", - "InteroperabilityVersion", ""}, + "InteroperabilityVersion", "", + { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_OOOO } }, {EXIF_TAG_IMAGE_WIDTH, "ImageWidth", N_("Image Width"), N_("The number of columns of image data, equal to the number of " "pixels per row. In JPEG compressed data a JPEG marker is " "used instead of this tag."), - {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}}, + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_IMAGE_LENGTH, "ImageLength", N_("Image Length"), N_("The number of rows of image data. In JPEG compressed data a " "JPEG marker is used instead of this tag."), - {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}}, + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_BITS_PER_SAMPLE, "BitsPerSample", N_("Bits per Sample"), N_("The number of bits per image component. In this standard each " "component of the image is 8 bits, so the value for this " - "tag is 9. See also <SamplesPerPixel>. In JPEG compressed data " + "tag is 8. See also <SamplesPerPixel>. In JPEG compressed data " "a JPEG marker is used instead of this tag."), - {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}}, + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_COMPRESSION, "Compression", N_("Compression"), N_("The compression scheme used for the image data. When a " "primary image is JPEG compressed, this designation is " "not necessary and is omitted. When thumbnails use JPEG " "compression, this tag value is set to 6."), - {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}}, + { ESL_MMMN, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_PHOTOMETRIC_INTERPRETATION, "PhotometricInterpretation", N_("Photometric Interpretation"), N_("The pixel composition. In JPEG compressed data a JPEG " "marker is used instead of this tag."), - {ESL_MANDATORY, ESL_MANDATORY, ESL_MANDATORY, ESL_NOT_RECORDED}}, + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_FILL_ORDER, "FillOrder", N_("Fill Order"), ""}, {EXIF_TAG_DOCUMENT_NAME, "DocumentName", N_("Document Name"), ""}, {EXIF_TAG_IMAGE_DESCRIPTION, "ImageDescription", @@ -87,92 +95,105 @@ static struct { "the like. Two-bytes character codes cannot be used. " "When a 2-bytes code is necessary, the Exif Private tag " "<UserComment> is to be used."), - {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}}, + { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_MAKE, "Make", N_("Manufacturer"), N_("The manufacturer of the recording " "equipment. This is the manufacturer of the DSC, scanner, " "video digitizer or other equipment that generated the " "image. When the field is left blank, it is treated as " "unknown."), - {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}}, + { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN }}, {EXIF_TAG_MODEL, "Model", N_("Model"), N_("The model name or model number of the equipment. This is the " "model name or number of the DSC, scanner, video digitizer " "or other equipment that generated the image. When the field " "is left blank, it is treated as unknown."), - {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}}, + { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_STRIP_OFFSETS, "StripOffsets", N_("Strip Offsets"), N_("For each strip, the byte offset of that strip. It is " "recommended that this be selected so the number of strip " "bytes does not exceed 64 Kbytes. With JPEG compressed " "data this designation is not needed and is omitted. See also " "<RowsPerStrip> and <StripByteCounts>."), - {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}}, + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_ORIENTATION, "Orientation", N_("Orientation"), N_("The image orientation viewed in terms of rows and columns."), - {ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY, ESL_CMANDATORY}}, + { ESL_OOOO, ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SAMPLES_PER_PIXEL, "SamplesPerPixel", N_("Samples per Pixel"), N_("The number of components per pixel. Since this standard applies " "to RGB and YCbCr images, the value set for this tag is 3. " "In JPEG compressed data a JPEG marker is used instead of this " - "tag.")}, + "tag."), + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_ROWS_PER_STRIP, "RowsPerStrip", N_("Rows per Strip"), N_("The number of rows per strip. This is the number of rows " "in the image of one strip when an image is divided into " "strips. With JPEG compressed data this designation is not " - "needed and is omitted. See also <RowsPerStrip> and " - "<StripByteCounts>.")}, + "needed and is omitted. See also <StripOffsets> and " + "<StripByteCounts>."), + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_STRIP_BYTE_COUNTS, "StripByteCounts", N_("Strip Byte Count"), N_("The total number of bytes in each strip. With JPEG compressed " - "data this designation is not needed and is omitted.")}, + "data this designation is not needed and is omitted."), + { ESL_MMMN, ESL_MMMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_X_RESOLUTION, "XResolution", N_("x-Resolution"), N_("The number of pixels per <ResolutionUnit> in the <ImageWidth> " "direction. When the image resolution is unknown, 72 [dpi] " - "is designated.")}, + "is designated."), + { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_Y_RESOLUTION, "YResolution", N_("y-Resolution"), N_("The number of pixels per <ResolutionUnit> in the <ImageLength> " - "direction. The same value as <XResolution> is designated.")}, + "direction. The same value as <XResolution> is designated."), + { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_PLANAR_CONFIGURATION, "PlanarConfiguration", N_("Planar Configuration"), N_("Indicates whether pixel components are recorded in a chunky " "or planar format. In JPEG compressed files a JPEG marker " "is used instead of this tag. If this field does not exist, " - "the TIFF default of 1 (chunky) is assumed.")}, + "the TIFF default of 1 (chunky) is assumed."), + { ESL_OMON, ESL_OMON, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_RESOLUTION_UNIT, "ResolutionUnit", N_("Resolution Unit"), N_("The unit for measuring <XResolution> and <YResolution>. The same " "unit is used for both <XResolution> and <YResolution>. If " - "the image resolution is unknown, 2 (inches) is designated.")}, + "the image resolution is unknown, 2 (inches) is designated."), + { ESL_MMMM, ESL_MMMM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_TRANSFER_FUNCTION, "TransferFunction", N_("Transfer Function"), N_("A transfer function for the image, described in tabular style. " "Normally this tag is not necessary, since color space is " - "specified in the color space information tag (<ColorSpace>).")}, + "specified in the color space information tag (<ColorSpace>)."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SOFTWARE, "Software", N_("Software"), N_("This tag records the name and version of the software or " "firmware of the camera or image input device used to " "generate the image. The detailed format is not specified, but " "it is recommended that the example shown below be " "followed. When the field is left blank, it is treated as " - "unknown.")}, + "unknown."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_DATE_TIME, "DateTime", N_("Date and Time"), N_("The date and time of image creation. In this standard " - "(EXIF-2.1) it is the date and time the file was changed.")}, + "(EXIF-2.1) it is the date and time the file was changed."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_ARTIST, "Artist", N_("Artist"), N_("This tag records the name of the camera owner, photographer or " "image creator. The detailed format is not specified, but it is " "recommended that the information be written as in the example " "below for ease of Interoperability. When the field is " - "left blank, it is treated as unknown.")}, + "left blank, it is treated as unknown."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_WHITE_POINT, "WhitePoint", N_("White Point"), N_("The chromaticity of the white point of the image. Normally " "this tag is not necessary, since color space is specified " - "in the colorspace information tag (<ColorSpace>).")}, + "in the color space information tag (<ColorSpace>)."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_PRIMARY_CHROMATICITIES, "PrimaryChromaticities", N_("Primary Chromaticities"), N_("The chromaticity of the three primary colors of the image. " - "Normally this tag is not necessary, since colorspace is " - "specified in the colorspace information tag (<ColorSpace>).")}, + "Normally this tag is not necessary, since color space is " + "specified in the color space information tag (<ColorSpace>)."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_TRANSFER_RANGE, "TransferRange", N_("Transfer Range"), ""}, {EXIF_TAG_SUB_IFDS, "SubIFDs", "SubIFD Offsets", N_("Defined by Adobe Corporation " "to enable TIFF Trees within a TIFF file.")}, @@ -181,7 +202,8 @@ static struct { N_("JPEG Interchange Format"), N_("The offset to the start byte (SOI) of JPEG compressed " "thumbnail data. This is not used for primary image " - "JPEG data.")}, + "JPEG data."), + { ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH, "JPEGInterchangeFormatLength", N_("JPEG Interchange Format Length"), N_("The number of bytes of JPEG compressed thumbnail data. This " @@ -190,7 +212,8 @@ static struct { "bitstream from SOI to EOI. Appn and COM markers should " "not be recorded. Compressed thumbnails must be recorded in no " "more than 64 Kbytes, including all other data to be " - "recorded in APP1.")}, + "recorded in APP1."), + { ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_YCBCR_COEFFICIENTS, "YCbCrCoefficients", N_("YCbCr Coefficients"), N_("The matrix coefficients for transformation from RGB to YCbCr " @@ -199,12 +222,14 @@ static struct { "as the default. The color space is declared in a " "color space information tag, with the default being the value " "that gives the optimal image characteristics " - "Interoperability this condition.")}, + "Interoperability this condition."), + { ESL_NNOO, ESL_NNOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_YCBCR_SUB_SAMPLING, "YCbCrSubSampling", N_("YCbCr Sub-Sampling"), N_("The sampling ratio of chrominance components in relation to the " "luminance component. In JPEG compressed data a JPEG marker " - "is used instead of this tag.")}, + "is used instead of this tag."), + { ESL_NNMN, ESL_NNMN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_YCBCR_POSITIONING, "YCbCrPositioning", N_("YCbCr Positioning"), N_("The position of chrominance components in relation to the " @@ -219,7 +244,8 @@ static struct { "does not have the capability of supporting both kinds of " "<YCbCrPositioning>, it shall follow the TIFF default regardless " "of the value in this field. It is preferable that readers " - "be able to support both centered and co-sited positioning.")}, + "be able to support both centered and co-sited positioning."), + { ESL_NNMM, ESL_NNOO, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_REFERENCE_BLACK_WHITE, "ReferenceBlackWhite", N_("Reference Black/White"), N_("The reference black point value and reference white point " @@ -227,7 +253,8 @@ static struct { "below are given as defaults here. The color space is declared " "in a color space information tag, with the default " "being the value that gives the optimal image characteristics " - "Interoperability these conditions.")}, + "Interoperability these conditions."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_XML_PACKET, "XMLPacket", N_("XML Packet"), N_("XMP Metadata")}, {EXIF_TAG_RELATED_IMAGE_FILE_FORMAT, "RelatedImageFileFormat", "RelatedImageFileFormat", ""}, @@ -263,84 +290,113 @@ static struct { "the photographer copyright part consists of one space followed " "by a terminating NULL code, then the editor copyright is given " "(see example 3). When the field is left blank, it is treated " - "as unknown.")}, + "as unknown."), + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_EXPOSURE_TIME, "ExposureTime", N_("Exposure Time"), - N_("Exposure time, given in seconds (sec).")}, + N_("Exposure time, given in seconds (sec)."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_FNUMBER, "FNumber", N_("FNumber"), - N_("The F number.")}, + N_("The F number."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_IPTC_NAA, "IPTC/NAA", "IPTC/NAA", ""}, {EXIF_TAG_IMAGE_RESOURCES, "ImageResources", N_("Image Resources Block"), ""}, - {EXIF_TAG_EXIF_IFD_POINTER, "ExifIFDPointer", "ExifIFDPointer", + {EXIF_TAG_EXIF_IFD_POINTER, "ExifIfdPointer", "ExifIFDPointer", N_("A pointer to the Exif IFD. Interoperability, Exif IFD has the " "same structure as that of the IFD specified in TIFF. " "ordinarily, however, it does not contain image data as in " - "the case of TIFF.")}, + "the case of TIFF."), + { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_INTER_COLOR_PROFILE, "InterColorProfile", "InterColorProfile", ""}, - {EXIF_TAG_EXPOSURE_PROGRAM, "ExposureProgram", "ExposureProgram", + {EXIF_TAG_EXPOSURE_PROGRAM, "ExposureProgram", N_("Exposure Program"), N_("The class of the program used by the camera to set exposure " - "when the picture is taken.")}, + "when the picture is taken."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SPECTRAL_SENSITIVITY, "SpectralSensitivity", N_("Spectral Sensitivity"), N_("Indicates the spectral sensitivity of each channel of the " "camera used. The tag value is an ASCII string compatible " - "with the standard developed by the ASTM Technical committee.")}, + "with the standard developed by the ASTM Technical Committee."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_GPS_INFO_IFD_POINTER, "GPSInfoIFDPointer", "GPSInfoIFDPointer", N_("A pointer to the GPS Info IFD. The " "Interoperability structure of the GPS Info IFD, like that of " - "Exif IFD, has no image data.")}, -#if 0 - {EXIF_TAG_GPS_VERSION_ID, "GPSVersionID", "", + "Exif IFD, has no image data."), + { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_GPS_VERSION_ID, "GPSVersionID", N_("GPS tag version"), N_("Indicates the version of <GPSInfoIFD>. The version is given " "as 2.0.0.0. This tag is mandatory when <GPSInfo> tag is " - "present. (Note: The <GPSVersionID tag is given in bytes, " + "present. (Note: The <GPSVersionID> tag is given in bytes, " "unlike the <ExifVersion> tag. When the version is " - "2.0.0.0, the tag value is 02000000.H).")}, - {EXIF_TAG_GPS_LATITUDE_REF, "GPSLatitudeRef", "" + "2.0.0.0, the tag value is 02000000.H)."), ESL_GPS}, + {EXIF_TAG_GPS_LATITUDE_REF, "GPSLatitudeRef", N_("North or South Latitude"), N_("Indicates whether the latitude is north or south latitude. The " "ASCII value 'N' indicates north latitude, and 'S' is south " - "latitude.")}, - {EXIF_TAG_GPS_LATITUDE, "GPSLatitude", "" + "latitude."), ESL_GPS}, + {EXIF_TAG_GPS_LATITUDE, "GPSLatitude", N_("Latitude"), N_("Indicates the latitude. The latitude is expressed as three " "RATIONAL values giving the degrees, minutes, and seconds, " "respectively. When degrees, minutes and seconds are expressed, " "the format is dd/1,mm/1,ss/1. When degrees and minutes are used " "and, for example, fractions of minutes are given up to two " - "two decimal places, the format is dd/1,mmmm/100,0/1.")}, - {EXIF_TAG_GPS_LONGITUDE_REF, "GPSLongitudeRef", "" + "decimal places, the format is dd/1,mmmm/100,0/1."), + ESL_GPS}, + {EXIF_TAG_GPS_LONGITUDE_REF, "GPSLongitudeRef", N_("East or West Longitude"), N_("Indicates whether the longitude is east or west longitude. " "ASCII 'E' indicates east longitude, and 'W' is west " - "longitude.")}, - {EXIF_TAG_GPS_LONGITUDE, "GPSLongitude", "" + "longitude."), ESL_GPS}, + {EXIF_TAG_GPS_LONGITUDE, "GPSLongitude", N_("Longitude"), N_("Indicates the longitude. The longitude is expressed as three " "RATIONAL values giving the degrees, minutes, and seconds, " "respectively. When degrees, minutes and seconds are expressed, " "the format is ddd/1,mm/1,ss/1. When degrees and minutes are " "used and, for example, fractions of minutes are given up to " - "two decimal places, the format is ddd/1,mmmm/100,0/1.")}, -#endif + "two decimal places, the format is ddd/1,mmmm/100,0/1."), + ESL_GPS}, + {EXIF_TAG_GPS_ALTITUDE_REF, "GPSAltitudeRef", N_("Altitude reference"), + N_("Indicates the altitude used as the reference altitude. If the " + "reference is sea level and the altitude is above sea level, 0 " + "is given. If the altitude is below sea level, a value of 1 is given " + "and the altitude is indicated as an absolute value in the " + "GSPAltitude tag. The reference unit is meters. Note that this tag " + "is BYTE type, unlike other reference tags."), ESL_GPS}, + {EXIF_TAG_GPS_ALTITUDE, "GPSAltitude", N_("Altitude"), + N_("Indicates the altitude based on the reference in GPSAltitudeRef. " + "Altitude is expressed as one RATIONAL value. The reference unit " + "is meters."), ESL_GPS}, + {EXIF_TAG_GPS_IMG_DIRECTION_REF, "GPSImgDirectionRef", N_("GPS Img Direction Reference"), + N_("Indicates the reference for giving the direction of the image when it is captured. " + "'T' denotes true direction and 'M' is magnetic direction."), ESL_GPS}, + {EXIF_TAG_GPS_IMG_DIRECTION, "GPSImgDirection", N_("GPS Img Direction"), + N_("Indicates the direction of the image when it was captured. The range of values is " + "from 0.00 to 359.99."), ESL_GPS}, {EXIF_TAG_ISO_SPEED_RATINGS, "ISOSpeedRatings", N_("ISO Speed Ratings"), N_("Indicates the ISO Speed and ISO Latitude of the camera or " - "input device as specified in ISO 12232.")}, + "input device as specified in ISO 12232."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_OECF, "OECF", "OECF", - N_("Indicates the Opto-Electoric Conversion Function (OECF) " + N_("Indicates the Opto-Electronic Conversion Function (OECF) " "specified in ISO 14524. <OECF> is the relationship between " - "the camera optical input and the image values.")}, + "the camera optical input and the image values."), + { 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.")}, + "field is taken to mean nonconformance to the standard."), + { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_DATE_TIME_ORIGINAL, "DateTimeOriginal", N_("Date and Time (original)"), N_("The date and time when the original image data was generated. " "For a digital still camera " - "the date and time the picture was taken are recorded.")}, + "the date and time the picture was taken are recorded."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_DATE_TIME_DIGITIZED, "DateTimeDigitized", N_("Date and Time (digitized)"), - N_("The date and time when the image was stored as digital data. ")}, + N_("The date and time when the image was stored as digital data. "), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_COMPONENTS_CONFIGURATION, "ComponentsConfiguration", - "ComponentsConfiguration", + N_("Components Configuration"), N_("Information specific to compressed data. The channels of " "each component are arranged in order from the 1st " "component to the 4th. For uncompressed data the data " @@ -348,44 +404,56 @@ static struct { "However, since <PhotometricInterpretation> can only " "express the order of Y, Cb and Cr, this tag is provided " "for cases when compressed data uses components other than " - "Y, Cb, and Cr and to enable support of other sequences.")}, + "Y, Cb, and Cr and to enable support of other sequences."), + { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_COMPRESSED_BITS_PER_PIXEL, "CompressedBitsPerPixel", N_("Compressed Bits per Pixel"), N_("Information specific to compressed data. The compression mode " "used for a compressed image is indicated in unit bits " - "per pixel.")}, + "per pixel."), + { ESL_NNNN, ESL_NNNN, ESL_NNNO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SHUTTER_SPEED_VALUE, "ShutterSpeedValue", N_("Shutter speed"), N_("Shutter speed. The unit is the APEX (Additive System of " - "Photographic Exposure) setting (see Appendix C).")}, + "Photographic Exposure) setting."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_APERTURE_VALUE, "ApertureValue", N_("Aperture"), - N_("The lens aperture. The unit is the APEX value.")}, + N_("The lens aperture. The unit is the APEX value."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_BRIGHTNESS_VALUE, "BrightnessValue", N_("Brightness"), N_("The value of brightness. The unit is the APEX value. " - "Ordinarily it is given in the range of -99.99 to 99.99.")}, + "Ordinarily it is given in the range of -99.99 to 99.99."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_EXPOSURE_BIAS_VALUE, "ExposureBiasValue", N_("Exposure Bias"), N_("The exposure bias. The units is the APEX value. Ordinarily " - "it is given in the range of -99.99 to 99.99.")}, + "it is given in the range of -99.99 to 99.99."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_MAX_APERTURE_VALUE, "MaxApertureValue", "MaxApertureValue", N_("The smallest F number of the lens. The unit is the APEX value. " "Ordinarily it is given in the range of 00.00 to 99.99, " - "but it is not limited to this range.")}, + "but it is not limited to this range."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SUBJECT_DISTANCE, "SubjectDistance", N_("Subject Distance"), - N_("The distance to the subject, given in meters.")}, + N_("The distance to the subject, given in meters."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_METERING_MODE, "MeteringMode", N_("Metering Mode"), - N_("The metering mode.")}, + N_("The metering mode."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_LIGHT_SOURCE, "LightSource", N_("Light Source"), - N_("The kind of light source.")}, + N_("The kind of light source."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_FLASH, "Flash", N_("Flash"), N_("This tag is recorded when an image is taken using a strobe " "light (flash).")}, {EXIF_TAG_FOCAL_LENGTH, "FocalLength", N_("Focal Length"), N_("The actual focal length of the lens, in mm. Conversion is not " - "made to the focal length of a 35 mm film camera.")}, + "made to the focal length of a 35 mm film camera."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_MAKER_NOTE, "MakerNote", N_("Maker Note"), N_("A tag for manufacturers of Exif writers to record any desired " - "information. The contents are up to the manufacturer.")}, + "information. The contents are up to the manufacturer."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_USER_COMMENT, "UserComment", N_("User Comment"), N_("A tag for Exif users to write keywords or comments on the image " "besides those in <ImageDescription>, and without the " @@ -396,7 +464,7 @@ static struct { "with NULL (\"00.h\"). ID codes are assigned by means of " "registration. The designation method and references for each " "character code are given in Table 6. The value of CountN " - "is determinated based on the 8 bytes in the character code " + "is determined based on the 8 bytes in the character code " "area and the number of bytes in the user comment part. Since " "the TYPE is not ASCII, NULL termination is not necessary " "(see Fig. 9). " @@ -409,20 +477,35 @@ static struct { "do not use the <UserComment> tag (see Table 7). " "When a <UserComment> area is set aside, it is recommended that " "the ID code be ASCII and that the following user comment " - "part be filled with blank characters [20.H].")}, + "part be filled with blank characters [20.H]."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SUB_SEC_TIME, "SubsecTime", "SubsecTime", N_("A tag used to record fractions of seconds for the " - "<DateTime> tag.")}, + "<DateTime> tag."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SUB_SEC_TIME_ORIGINAL, "SubSecTimeOriginal", "SubSecTimeOriginal", N_("A tag used to record fractions of seconds for the " - "<DateTimeOriginal> tag.")}, + "<DateTimeOriginal> tag."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_SUB_SEC_TIME_DIGITIZED, "SubSecTimeDigitized", "SubSecTimeDigitized", N_("A tag used to record fractions of seconds for the " - "<DateTimeDigitized> tag.")}, + "<DateTimeDigitized> tag."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_XP_TITLE, "XPTitle", N_("XP Title"), "", + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_XP_COMMENT, "XPComment", N_("XP Comment"), "", + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_XP_AUTHOR, "XPAuthor", N_("XP Author"), "", + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_XP_KEYWORDS, "XPKeywords", N_("XP Keywords"), "", + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, + {EXIF_TAG_XP_SUBJECT, "XPSubject", N_("XP Subject"), "", + { ESL_OOOO, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_FLASH_PIX_VERSION, "FlashPixVersion", "FlashPixVersion", - N_("The FlashPix format version supported by a FPXR file.")}, + N_("The FlashPix format version supported by a FPXR file."), + { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_COLOR_SPACE, "ColorSpace", N_("Color Space"), N_("The color space information tag is always " "recorded as the color space specifier. Normally sRGB (=1) " @@ -430,14 +513,15 @@ static struct { "conditions and environment. If a color space other than " "sRGB is used, Uncalibrated (=FFFF.H) is set. Image data " "recorded as Uncalibrated can be treated as sRGB when it is " - "converted to FlashPix. On sRGB see Appendix E.")}, + "converted to FlashPix."), + { ESL_NNNN, ESL_NNNN, ESL_MMMM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_PIXEL_X_DIMENSION, "PixelXDimension", "PixelXDimension", N_("Information specific to compressed data. When a " "compressed file is recorded, the valid width of the " "meaningful image must be recorded in this tag, whether or " "not there is padding data or a restart marker. This tag " - "should not exist in an uncompressed file. For details see " - "section 2.8.1 and Appendix F.")}, + "should not exist in an uncompressed file."), + { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_PIXEL_Y_DIMENSION, "PixelYDimension", "PixelYDimension", N_("Information specific to compressed data. When a compressed " "file is recorded, the valid height of the meaningful image " @@ -446,7 +530,8 @@ static struct { "uncompressed file. For details see section 2.8.1 and Appendix " "F. Since data padding is unnecessary in the vertical direction, " "the number of lines recorded in this valid image height tag " - "will in fact be the same as that recorded in the SOF.")}, + "will in fact be the same as that recorded in the SOF."), + { ESL_NNNN, ESL_NNNN, ESL_NNNM, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_RELATED_SOUND_FILE, "RelatedSoundFile", "RelatedSoundFile", N_("This tag is used to record the name of an audio file related " @@ -478,7 +563,8 @@ static struct { "information is an ASCII character string, it is terminated by " "NULL. When this tag is used to map audio files, the relation " "of the audio file to image data must also be indicated on the " - "audio file end.")}, + "audio file end."), + { ESL_NNNN, ESL_NNNN, ESL_OOOO, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_INTEROPERABILITY_IFD_POINTER, "InteroperabilityIFDPointer", "InteroperabilityIFDPointer", N_("Interoperability IFD is composed of tags which stores the " @@ -488,7 +574,8 @@ static struct { "the same as TIFF defined IFD structure " "but does not contain the " "image data characteristically compared with normal TIFF " - "IFD.")}, + "IFD."), + { ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN, ESL_NNNN } }, {EXIF_TAG_FLASH_ENERGY, "FlashEnergy", N_("Flash Energy"), N_("Indicates the strobe energy at the time the image is " "captured, as measured in Beam Candle Power Seconds (BCPS).")}, @@ -517,9 +604,9 @@ static struct { "value of this tag represents the pixel at the center of the " "main subject relative to the left edge, prior to rotation " "processing as per the <Rotation> tag. The first value " - "indicates the X column number and second indicates " + "indicates the X column number and the second indicates " "the Y row number.")}, - {EXIF_TAG_EXPOSURE_INDEX, "ExposureIndex", N_("Exposure index"), + {EXIF_TAG_EXPOSURE_INDEX, "ExposureIndex", N_("Exposure Index"), N_("Indicates the exposure index selected on the camera or " "input device at the time the image is captured.")}, {EXIF_TAG_SENSING_METHOD, "SensingMethod", N_("Sensing Method"), @@ -527,7 +614,7 @@ static struct { "device.")}, {EXIF_TAG_FILE_SOURCE, "FileSource", N_("File Source"), N_("Indicates the image source. If a DSC recorded the image, " - "this tag value of this tag always be set to 3, indicating " + "the tag value of this tag always be set to 3, indicating " "that the image was recorded on a DSC.")}, {EXIF_TAG_SCENE_TYPE, "SceneType", N_("Scene Type"), N_("Indicates the type of scene. If a DSC recorded the image, " @@ -570,7 +657,7 @@ static struct { N_("This tag indicates the type of scene that was shot. It can " "also be used to record the mode in which the image was " "shot. Note that this differs from the scene type " - "(SceneType) tag.")}, + "<SceneType> tag.")}, {EXIF_TAG_GAIN_CONTROL, "GainControl", N_("Gain Control"), N_("This tag indicates the degree of overall image gain " "adjustment.")}, @@ -596,6 +683,11 @@ static struct { N_("This tag indicates an identifier assigned uniquely to " "each image. It is recorded as an ASCII string equivalent " "to hexadecimal notation and 128-bit fixed length.")}, + {EXIF_TAG_GAMMA, "Gamma", N_("Gamma"), + N_("Indicates the value of coefficient gamma.")}, + {EXIF_TAG_PRINT_IMAGE_MATCHING, "PrintImageMatching", N_("PRINT Image Matching"), + N_("Related to Epson's PRINT Image Matching technology")}, +#endif {0, NULL, NULL, NULL} }; @@ -622,55 +714,144 @@ exif_tag_table_count (void) return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]); } +#define RECORDED \ +((ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \ + (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \ + (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_UNCOMPRESSED_YCC] != EXIF_SUPPORT_LEVEL_NOT_RECORDED) || \ + (ExifTagTable[i].esl[ifd][EXIF_DATA_TYPE_COMPRESSED] != EXIF_SUPPORT_LEVEL_NOT_RECORDED)) + const char * -exif_tag_get_name (ExifTag tag) +exif_tag_get_name_in_ifd (ExifTag tag, ExifIfd ifd) { unsigned int i; + if (ifd >= EXIF_IFD_COUNT) return NULL; for (i = 0; ExifTagTable[i].name; i++) - if (ExifTagTable[i].tag == tag) - break; - + if ((ExifTagTable[i].tag == tag) && RECORDED) break; return ExifTagTable[i].name; } const char * -exif_tag_get_title (ExifTag tag) +exif_tag_get_title_in_ifd (ExifTag tag, ExifIfd ifd) { unsigned int i; /* FIXME: This belongs to somewhere else. */ - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + /* libexif should use the default system locale. + * If an application specifically requires UTF-8, then we + * must give the application a way to tell libexif that. + * + * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + */ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - + if (ifd >= EXIF_IFD_COUNT) return NULL; for (i = 0; ExifTagTable[i].title; i++) - if (ExifTagTable[i].tag == tag) break; + if ((ExifTagTable[i].tag == tag) && RECORDED) break; return _(ExifTagTable[i].title); } const char * -exif_tag_get_description (ExifTag tag) +exif_tag_get_description_in_ifd (ExifTag tag, ExifIfd ifd) { unsigned int i; - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + /* libexif should use the default system locale. + * If an application specifically requires UTF-8, then we + * must give the application a way to tell libexif that. + * + * bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + */ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + if (ifd >= EXIF_IFD_COUNT) return NULL; for (i = 0; ExifTagTable[i].description; i++) - if (ExifTagTable[i].tag == tag) break; - return _(ExifTagTable[i].description); + if ((ExifTagTable[i].tag == tag) && RECORDED) { + /* GNU gettext acts strangely when given an empty string */ + if (!*ExifTagTable[i].description) + return ""; + return _(ExifTagTable[i].description); + } + return NULL; +} + + +/********************************************************************** + * convenience functions + **********************************************************************/ + +/* generic part: iterate through IFD list and return first result */ +typedef const char * (*get_stuff_func) (ExifTag tag, ExifIfd ifd); + +static const char * +exif_tag_get_stuff (ExifTag tag, get_stuff_func func) +{ + static const ExifIfd ifds[5] = { + EXIF_IFD_0, + EXIF_IFD_1, + EXIF_IFD_EXIF, + EXIF_IFD_INTEROPERABILITY, + EXIF_IFD_GPS + }; + int i; + for (i=0; i<5; i++) { + const char *result = func(tag, ifds[i]); + if (result != NULL) { + return result; + } + } + return (const char *) NULL; +} + +/* explicit functions */ +const char * +exif_tag_get_name (ExifTag tag) +{ + return exif_tag_get_stuff(tag, exif_tag_get_name_in_ifd); } +const char * +exif_tag_get_title (ExifTag tag) +{ + return exif_tag_get_stuff(tag, exif_tag_get_title_in_ifd); +} + +const char * +exif_tag_get_description (ExifTag tag) +{ + return exif_tag_get_stuff (tag, exif_tag_get_description_in_ifd); +} + + + ExifTag exif_tag_from_name (const char *name) { unsigned int i; + unsigned int result=0; if (!name) return 0; for (i = 0; ExifTagTable[i].name; i++) - if (!strcmp (ExifTagTable[i].name, name)) break; - return ExifTagTable[i].tag; + if (!strcmp (ExifTagTable[i].name, name)) { + result = ExifTagTable[i].tag; + break; + } + return result; +} + +ExifSupportLevel +exif_tag_get_support_level_in_ifd (ExifTag tag, ExifIfd ifd, ExifDataType t) +{ + unsigned int i; + + if (ifd >= EXIF_IFD_COUNT) return EXIF_SUPPORT_LEVEL_UNKNOWN; + if (t >= EXIF_DATA_TYPE_COUNT) return EXIF_SUPPORT_LEVEL_UNKNOWN; + + for (i = 0; ExifTagTable[i].description; i++) + if ((ExifTagTable[i].tag == tag) && + (ExifTagTable[i].esl[ifd][t] != EXIF_SUPPORT_LEVEL_NOT_RECORDED)) + return ExifTagTable[i].esl[ifd][t]; + return EXIF_SUPPORT_LEVEL_NOT_RECORDED; } const char * @@ -683,4 +864,3 @@ exif_tag_get_name_index (unsigned int i, ExifTag *tag) return (ExifTagTable[i].name); } - |