Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/Metadata/TagLib.cpp view on Meta::CPAN
// ==========================================================
// Implementation notes :
// ----------------------
// The tag info tables declared in this file should probably
// be loaded from an XML file.
// This would allow internationalization features and also
// more extensibility.
// Maybe in a future release ?
// ==========================================================
#ifdef _MSC_VER
#pragma warning (disable : 4786) // identifier was truncated to 'number' characters
#endif
#include "FreeImage.h"
#include "Utilities.h"
#include "FreeImageTag.h"
/**
HOW-TO : add a new TagInfo table
--------------------------------------------------------------------------
1) add a table identifier in the TagLib class definition (see enum MDMODEL)
2) declare the tag table as static and use a 0/NULL value as last entry
3) initialize the table in TagLib::TagLib
4) provide a conversion in TagLib::getFreeImageModel
*/
// --------------------------------------------------------------------------
// EXIF standard tags definition
// --------------------------------------------------------------------------
static TagInfo
exif_exif_tag_table[] =
{
{ 0x0100, (char *) "ImageWidth", (char *) "Image width"},
{ 0x0101, (char *) "ImageLength", (char *) "Image height"},
{ 0x0102, (char *) "BitsPerSample", (char *) "Number of bits per component"},
{ 0x0103, (char *) "Compression", (char *) "Compression scheme"},
{ 0x0106, (char *) "PhotometricInterpretation", (char *) "Pixel composition"},
{ 0x010A, (char *) "FillOrder", (char*) NULL},
{ 0x010D, (char *) "DocumentName", (char *) NULL},
{ 0x010E, (char *) "ImageDescription", (char *) "Image title"},
{ 0x010F, (char *) "Make", (char *) "Image input equipment manufacturer"},
{ 0x0110, (char *) "Model", (char *) "Image input equipment model"},
{ 0x0111, (char *) "StripOffsets", (char *) "Image data location"},
{ 0x0112, (char *) "Orientation", (char *) "Orientation of image"},
{ 0x0115, (char *) "SamplesPerPixel", (char *) "Number of components"},
{ 0x0116, (char *) "RowsPerStrip", (char *) "Number of rows per strip"},
{ 0x0117, (char *) "StripByteCounts", (char *) "Bytes per compressed strip"},
{ 0x011A, (char *) "XResolution", (char *) "Image resolution in width direction"},
{ 0x011B, (char *) "YResolution", (char *) "Image resolution in height direction"},
{ 0x011C, (char *) "PlanarConfiguration", (char *) "Image data arrangement"},
{ 0x011D, (char *) "PageName", (char *) "Name of the page"},
{ 0x011E, (char *) "XPosition", (char *) "X position of the image"},
{ 0x011F, (char *) "YPosition", (char *) "Y position of the image"},
{ 0x0128, (char *) "ResolutionUnit", (char *) "Unit of X and Y resolution"},
{ 0x0129, (char *) "PageNumber", (char *) "Page number"},
{ 0x012D, (char *) "TransferFunction", (char *) "Transfer function"},
{ 0x0131, (char *) "Software", (char *) "Software used"},
{ 0x0132, (char *) "DateTime", (char *) "File change date and time"},
{ 0x013B, (char *) "Artist", (char *) "Person who created the image"},
{ 0x013C, (char *) "HostComputer", (char *) "Host computer used to generate the image"},
{ 0x013E, (char *) "WhitePoint", (char *) "White point chromaticity"},
{ 0x013F, (char *) "PrimaryChromaticities", (char *) "Chromaticities of primaries"},
{ 0x0156, (char *) "TransferRange", (char *) NULL},
{ 0x0200, (char *) "JPEGProc", (char *) NULL},
{ 0x0201, (char *) "JPEGInterchangeFormat", (char *) "Offset to JPEG SOI"},
{ 0x0202, (char *) "JPEGInterchangeFormatLength", (char *) "Bytes of JPEG data"},
{ 0x0211, (char *) "YCbCrCoefficients", (char *) "Color space transformation matrix coefficients"},
{ 0x0212, (char *) "YCbCrSubSampling", (char *) "Subsampling ratio of Y to C"},
{ 0x0213, (char *) "YCbCrPositioning", (char *) "Y and C positioning"},
{ 0x0214, (char *) "ReferenceBlackWhite", (char *) "Pair of black and white reference values"},
{ 0x828D, (char *) "CFARepeatPatternDim", (char *) NULL},
{ 0x828E, (char *) "CFAPattern", (char *) NULL},
{ 0x828F, (char *) "BatteryLevel", (char *) NULL},
{ 0x8298, (char *) "Copyright", (char *) "Copyright holder"},
{ 0x829A, (char *) "ExposureTime", (char *) "Exposure time"},
{ 0x829D, (char *) "FNumber", (char *) "F number"},
{ 0x83BB, (char *) "IPTC/NAA", (char *) NULL},
{ 0x8773, (char *) "InterColorProfile", (char *) NULL},
{ 0x8822, (char *) "ExposureProgram", (char *) "Exposure program"},
{ 0x8824, (char *) "SpectralSensitivity", (char *) "Spectral sensitivity"},
{ 0x8825, (char *) "GPSInfo", (char *) NULL},
{ 0x8827, (char *) "ISOSpeedRatings", (char *) "ISO speed rating"},
{ 0x8828, (char *) "OECF", (char *) "Optoelectric conversion factor"},
{ 0x9000, (char *) "ExifVersion", (char *) "Exif version"},
{ 0x9003, (char *) "DateTimeOriginal", (char *) "Date and time of original data generation"},
{ 0x9004, (char *) "DateTimeDigitized", (char *) "Date and time of digital data generation"},
{ 0x9101, (char *) "ComponentsConfiguration", (char *) "Meaning of each component"},
{ 0x9102, (char *) "CompressedBitsPerPixel", (char *) "Image compression mode"},
{ 0x9201, (char *) "ShutterSpeedValue", (char *) "Shutter speed"},
{ 0x9202, (char *) "ApertureValue", (char *) "Aperture"},
{ 0x9203, (char *) "BrightnessValue", (char *) "Brightness"},
{ 0x9204, (char *) "ExposureBiasValue", (char *) "Exposure bias"},
{ 0x9205, (char *) "MaxApertureValue", (char *) "Maximum lens aperture"},
{ 0x9206, (char *) "SubjectDistance", (char *) "Subject distance"},
{ 0x9207, (char *) "MeteringMode", (char *) "Metering mode"},
{ 0x9208, (char *) "LightSource", (char *) "Light source"},
{ 0x9209, (char *) "Flash", (char *) "Flash"},
{ 0x920A, (char *) "FocalLength", (char *) "Lens focal length"},
{ 0x9214, (char *) "SubjectArea", (char *) "Subject area"},
{ 0x927C, (char *) "MakerNote", (char *) "Manufacturer notes"},
{ 0x9286, (char *) "UserComment", (char *) "User comments"},
{ 0x9290, (char *) "SubSecTime", (char *) "DateTime subseconds"},
{ 0x9291, (char *) "SubSecTimeOriginal", (char *) "DateTimeOriginal subseconds"},
{ 0x9292, (char *) "SubSecTimeDigitized", (char *) "DateTimeDigitized subseconds"},
{ 0xA000, (char *) "FlashPixVersion", (char *) "Supported Flashpix version"},
{ 0xA001, (char *) "ColorSpace", (char *) "Color space information"},
{ 0xA002, (char *) "PixelXDimension", (char *) "Valid image width"},
{ 0xA003, (char *) "PixelYDimension", (char *) "Valid image height"},
{ 0xA004, (char *) "RelatedSoundFile", (char *) "Related audio file"},
{ 0xA005, (char *) "InteroperabilityOffset", (char *) NULL},
{ 0xA20B, (char *) "FlashEnergy", (char *) "Flash energy"},
{ 0xA20C, (char *) "SpatialFrequencyResponse", (char *) "Spatial frequency response"},
{ 0xA20E, (char *) "FocalPlaneXResolution", (char *) "Focal plane X resolution"},
{ 0xA20F, (char *) "FocalPlaneYResolution", (char *) "Focal plane Y resolution"},
{ 0xA210, (char *) "FocalPlaneResolutionUnit", (char *) "Focal plane resolution unit"},
{ 0xA214, (char *) "SubjectLocation", (char *) "Subject location"},
{ 0xA215, (char *) "ExposureIndex", (char *) "Exposure index"},
{ 0xA217, (char *) "SensingMethod", (char *) "Sensing method"},
{ 0xA300, (char *) "FileSrc", (char *) "File source"},
{ 0xA301, (char *) "SceneType", (char *) "Scene type"},
{ 0xA302, (char *) "CFAPattern", (char *) "CFA pattern"},
{ 0xA401, (char *) "CustomRendered", (char *) "Custom image processing"},
{ 0xA402, (char *) "ExposureMode", (char *) "Exposure mode"},
{ 0xA403, (char *) "WhiteBalance", (char *) "White balance"},
{ 0xA404, (char *) "DigitalZoomRatio", (char *) "Digital zoom ratio"},
{ 0xA405, (char *) "FocalLengthIn35mmFilm", (char *) "Focal length in 35 mm film"},
{ 0xA406, (char *) "SceneCaptureType", (char *) "Scene capture type"},
{ 0xA407, (char *) "GainControl", (char *) "Gain control"},
{ 0xA408, (char *) "Contrast", (char *) "Contrast"},
{ 0xA409, (char *) "Saturation", (char *) "Saturation"},
{ 0xA40A, (char *) "Sharpness", (char *) "Sharpness"},
{ 0xA40B, (char *) "DeviceSettingDescription", (char *) "Device settings description"},
{ 0xA40C, (char *) "SubjectDistanceRange", (char *) "Subject distance range"},
{ 0xA420, (char *) "ImageUniqueID", (char *) "Unique image ID"},
{ 0xA430, (char *) "CameraOwnerName", (char *) "Camera owner name"},
{ 0xA431, (char *) "BodySerialNumber", (char *) "Body serial number"},
{ 0xA432, (char *) "LensSpecification", (char *) "Lens specification"},
{ 0xA433, (char *) "LensMake", (char *) "Lens make"},
{ 0xA434, (char *) "LensModel", (char *) "Lens model"},
{ 0xA435, (char *) "LensSerialNumber", (char *) "Lens serial number"},
// These tags are not part of the Exiv v2.3 specifications but are often loaded by applications as Exif data
{ 0x4746, (char *) "Rating", (char *) "Rating tag used by Windows"},
{ 0x4749, (char *) "RatingPercent", (char *) "Rating tag used by Windows, value in percent"},
{ 0x9C9B, (char *) "XPTitle", (char *) "Title tag used by Windows, encoded in UCS2"},
{ 0x9C9C, (char *) "XPComment", (char *) "Comment tag used by Windows, encoded in UCS2"},
{ 0x9C9D, (char *) "XPAuthor", (char *) "Author tag used by Windows, encoded in UCS2"},
{ 0x9C9E, (char *) "XPKeywords", (char *) "Keywords tag used by Windows, encoded in UCS2"},
{ 0x9C9F, (char *) "XPSubject", (char *) "Subject tag used by Windows, encoded in UCS2"},
{ 0x0000, (char *) NULL, (char *) NULL}
};
// --------------------------------------------------------------------------
// EXIF GPS tags definition
// --------------------------------------------------------------------------
static TagInfo
exif_gps_tag_table[] =
{
{ 0x0000, (char *) "GPSVersionID", (char *) "GPS tag version"},
{ 0x0001, (char *) "GPSLatitudeRef", (char *) "North or South Latitude"},
{ 0x0002, (char *) "GPSLatitude", (char *) "Latitude"},
{ 0x0003, (char *) "GPSLongitudeRef", (char *) "East or West Longitude"},
{ 0x0004, (char *) "GPSLongitude", (char *) "Longitude"},
( run in 1.096 second using v1.01-cache-2.11-cpan-5735350b133 )