[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:37:37 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=f6af75c
The following commit has been merged in the master branch:
commit f6af75cfdf7f125d9ec5419f482742d4ede42a2d
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Fri May 19 08:48:21 2006 +0000
Minor updates and preparations for better decoding of TIFF-based RAW formats
---
src/makernote2.hpp | 3 +-
src/minoltamn.cpp | 110 +++++++++++++++++++++++++-------------------------
src/minoltamn.hpp | 10 ++---
src/tiffcomposite.cpp | 85 +++++++++++++++++++++++---------------
src/tiffcomposite.hpp | 4 ++
src/tiffparser.cpp | 5 ++-
src/tiffvisitor.cpp | 99 ++++++++++++++++++++++++++++++++-------------
src/tiffvisitor.hpp | 80 ++++++++++++++++++++++++++++++++----
src/types.hpp | 9 ++++-
9 files changed, 272 insertions(+), 133 deletions(-)
diff --git a/src/makernote2.hpp b/src/makernote2.hpp
index b1f3e4b..b96af52 100644
--- a/src/makernote2.hpp
+++ b/src/makernote2.hpp
@@ -83,8 +83,7 @@ namespace Exiv2 {
@brief Compare a TiffMnRegistry structure with a TiffMnRegistry::Key
The two are equal if TiffMnRegistry::make_ equals a substring
of the key of the same size. E.g., registry = "OLYMPUS",
- key = "OLYMPUS OPTICAL CO.,LTD" (found in the makernote of
- the image) match.
+ key = "OLYMPUS OPTICAL CO.,LTD" (found in the image) match.
*/
bool operator==(const Key& key) const;
diff --git a/src/minoltamn.cpp b/src/minoltamn.cpp
index 3d95cf0..ce1d0fe 100644
--- a/src/minoltamn.cpp
+++ b/src/minoltamn.cpp
@@ -153,15 +153,15 @@ namespace Exiv2 {
TagInfo(0x0081, "Thumbnail", "Thumbnail", "Jpeg thumbnail 640x480 pixels", minoltaIfdId, makerTags, undefined, printValue),
TagInfo(0x0088, "ThumbnailOffset", "Thumbnail Offset", "Offset of the thumbnail", minoltaIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x0089, "ThumbnailLength", "Thumbnail Length", "Size of the thumbnail", minoltaIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x0101, "ColorMode", "Color Mode", "Color mode", minoltaIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaColorMode), minoltaColorMode>),
- TagInfo(0x0102, "Quality", "Image Quality", "Image quality", minoltaIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaImageQuality), minoltaImageQuality>),
+ TagInfo(0x0101, "ColorMode", "Color Mode", "Color mode", minoltaIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaColorMode), minoltaColorMode>),
+ TagInfo(0x0102, "Quality", "Image Quality", "Image quality", minoltaIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaImageQuality), minoltaImageQuality>),
// TODO: Tag 0x0103 : quality or image size (see ExifTool doc).
- TagInfo(0x0107, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaImageStabilization), minoltaImageStabilization>),
- TagInfo(0x010a, "ZoneMatching", "Zone Matching", "Zone matching", minoltaIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaZoneMatching), minoltaZoneMatching>),
+ TagInfo(0x0107, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaImageStabilization), minoltaImageStabilization>),
+ TagInfo(0x010a, "ZoneMatching", "Zone Matching", "Zone matching", minoltaIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaZoneMatching), minoltaZoneMatching>),
TagInfo(0x010b, "ColorTemperature", "Color Temperature", "Color temperature", minoltaIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x010c, "LensID", "Lens ID", "Lens ID", minoltaIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaLensID), minoltaLensID>),
+ TagInfo(0x010c, "LensID", "Lens ID", "Lens ID", minoltaIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaLensID), minoltaLensID>),
TagInfo(0x0114, "CameraSettings5D", "Camera Settings (5D)", "Camera Settings (for Dynax 5D model)", minoltaIfdId, makerTags, undefined, printValue),
TagInfo(0x0e00, "PIM_IFD", "PIM IFD", "PIM information", minoltaIfdId, makerTags, undefined, printValue),
TagInfo(0x0f00, "CameraSettingsZ1", "Camera Settings (Z1)", "Camera Settings (for Z1, DImage X, and F100 models)", minoltaIfdId, makerTags, undefined, printValue),
@@ -479,56 +479,56 @@ namespace Exiv2 {
// Minolta Standard Camera Settings Tag Info (Old and New)
const TagInfo MinoltaMakerNote::tagInfoCsStd_[] = {
- TagInfo(0x0001, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaExposureModeStd), minoltaExposureModeStd>),
- TagInfo(0x0002, "FlashMode", "Flash Mode", "Flash mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFlashModeStd), minoltaFlashModeStd>),
- TagInfo(0x0003, "WhiteBalance", "White Balance", "White balance", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaWhiteBalanceStd), minoltaWhiteBalanceStd>),
- TagInfo(0x0004, "ImageSize", "Image Size", "Image size", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaImageSizeStd), minoltaImageSizeStd>),
- TagInfo(0x0005, "Quality", "Image Quality", "Image quality", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaImageQualityStd), minoltaImageQualityStd>),
- TagInfo(0x0006, "DriveMode", "Drive Mode", "Drive mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaDriveModeStd), minoltaDriveModeStd>),
- TagInfo(0x0007, "MeteringMode", "Metering Mode", "Metering mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaMeteringModeStd), minoltaMeteringModeStd>),
+ TagInfo(0x0001, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaExposureModeStd), minoltaExposureModeStd>),
+ TagInfo(0x0002, "FlashMode", "Flash Mode", "Flash mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFlashModeStd), minoltaFlashModeStd>),
+ TagInfo(0x0003, "WhiteBalance", "White Balance", "White balance", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaWhiteBalanceStd), minoltaWhiteBalanceStd>),
+ TagInfo(0x0004, "ImageSize", "Image Size", "Image size", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaImageSizeStd), minoltaImageSizeStd>),
+ TagInfo(0x0005, "Quality", "Image Quality", "Image quality", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaImageQualityStd), minoltaImageQualityStd>),
+ TagInfo(0x0006, "DriveMode", "Drive Mode", "Drive mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaDriveModeStd), minoltaDriveModeStd>),
+ TagInfo(0x0007, "MeteringMode", "Metering Mode", "Metering mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaMeteringModeStd), minoltaMeteringModeStd>),
TagInfo(0x0008, "ExposureSpeed", "Exposure Speed", "Exposure speed", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaExposureSpeedStd),
TagInfo(0x0009, "ExposureTime", "Exposure Time", "Exposure time", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaExposureTimeStd),
TagInfo(0x000A, "FNumber", "FNumber", "FNumber", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaFNumberStd),
- TagInfo(0x000B, "MacroMode", "Macro Mode", "Macro mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaMacroModeStd), minoltaMacroModeStd>),
- TagInfo(0x000C, "DigitalZoom", "Digital Zoom", "Digital zoom", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaDigitalZoomStd), minoltaDigitalZoomStd>),
+ TagInfo(0x000B, "MacroMode", "Macro Mode", "Macro mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaMacroModeStd), minoltaMacroModeStd>),
+ TagInfo(0x000C, "DigitalZoom", "Digital Zoom", "Digital zoom", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaDigitalZoomStd), minoltaDigitalZoomStd>),
TagInfo(0x000D, "ExposureCompensation", "Exposure Compensation", "Exposure compensation", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaExposureCompensationStd),
- TagInfo(0x000E, "BracketStep", "Bracket Step", "Bracket step", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaBracketStepStd), minoltaBracketStepStd>),
+ TagInfo(0x000E, "BracketStep", "Bracket Step", "Bracket step", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaBracketStepStd), minoltaBracketStepStd>),
TagInfo(0x0010, "IntervalLength", "Interval Length", "Interval length", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x0011, "IntervalNumber", "Interval Number", "Interval number", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x0012, "FocalLength", "Focal Length", "Focal length", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaFocalLengthStd),
TagInfo(0x0013, "FocusDistance", "Focus Distance", "Focus distance", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x0014, "Flash", "Flash", "Flash", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFlashStd), minoltaFlashStd>),
+ TagInfo(0x0014, "Flash", "Flash", "Flash", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFlashStd), minoltaFlashStd>),
TagInfo(0x0015, "MinoltaDate", "Minolta Date", "Minolta date", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaDateStd),
TagInfo(0x0016, "MinoltaTime", "Minolta Time", "Minolta time", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaTimeStd),
TagInfo(0x0017, "MaxAperture", "Max Aperture", "Max aperture", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x001A, "FileNumberMemory", "File Number Memory", "File number memory", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFileNumberMemoryStd), minoltaFileNumberMemoryStd>),
+ TagInfo(0x001A, "FileNumberMemory", "File Number Memory", "File number memory", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFileNumberMemoryStd), minoltaFileNumberMemoryStd>),
TagInfo(0x001B, "ImageNumber", "Image Number", "Image number", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x001C, "ColorBalanceRed", "Color Balance Red", "Color balance red", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaWhiteBalanceStd),
TagInfo(0x001D, "ColorBalanceGreen", "Color Balance Green", "Color balance green", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaWhiteBalanceStd),
TagInfo(0x001E, "ColorBalanceBlue", "Color Balance Blue", "Color balance blue", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaWhiteBalanceStd),
TagInfo(0x001F, "Saturation", "Saturation", "Saturation", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x0020, "Contrast", "Contrast", "Contrast", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x0021, "Sharpness", "Sharpness", "Sharpness", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaSharpnessStd), minoltaSharpnessStd>),
- TagInfo(0x0022, "SubjectProgram", "Subject Program", "Subject program", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaSubjectProgramStd), minoltaSubjectProgramStd>),
+ TagInfo(0x0021, "Sharpness", "Sharpness", "Sharpness", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaSharpnessStd), minoltaSharpnessStd>),
+ TagInfo(0x0022, "SubjectProgram", "Subject Program", "Subject program", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaSubjectProgramStd), minoltaSubjectProgramStd>),
TagInfo(0x0023, "FlashExposureComp", "Flash Exposure Compensation", "Flash exposure compensation in EV", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaFlashExposureCompStd),
- TagInfo(0x0024, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaISOSettingStd), minoltaISOSettingStd>),
- TagInfo(0x0025, "MinoltaModel", "Minolta Model", "Minolta model", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaModelStd), minoltaModelStd>),
- TagInfo(0x0026, "IntervalMode", "Interval Mode", "Interval mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaIntervalModeStd), minoltaIntervalModeStd>),
- TagInfo(0x0027, "FolderName", "Folder Name", "Folder name", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFolderNameStd), minoltaFolderNameStd>),
- TagInfo(0x0028, "ColorMode", "ColorMode", "ColorMode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaColorModeStd), minoltaColorModeStd>),
+ TagInfo(0x0024, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaISOSettingStd), minoltaISOSettingStd>),
+ TagInfo(0x0025, "MinoltaModel", "Minolta Model", "Minolta model", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaModelStd), minoltaModelStd>),
+ TagInfo(0x0026, "IntervalMode", "Interval Mode", "Interval mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaIntervalModeStd), minoltaIntervalModeStd>),
+ TagInfo(0x0027, "FolderName", "Folder Name", "Folder name", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFolderNameStd), minoltaFolderNameStd>),
+ TagInfo(0x0028, "ColorMode", "ColorMode", "ColorMode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaColorModeStd), minoltaColorModeStd>),
TagInfo(0x0029, "ColorFilter", "Color Filter", "Color filter", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x002A, "BWFilter", "Black White Filter", "Black and white filter", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x002B, "InternalFlash", "Internal Flash", "Internal flash", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaInternalFlashStd), minoltaInternalFlashStd>),
+ TagInfo(0x002B, "InternalFlash", "Internal Flash", "Internal flash", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaInternalFlashStd), minoltaInternalFlashStd>),
TagInfo(0x002C, "Brightness", "Brightness", "Brightness", minoltaCsNewIfdId, makerTags, unsignedLong, printMinoltaBrightnessStd),
TagInfo(0x002D, "SpotFocusPointX", "Spot Focus Point X", "Spot focus point X", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
TagInfo(0x002E, "SpotFocusPointY", "Spot Focus Point Y", "Spot focus point Y", minoltaCsNewIfdId, makerTags, unsignedLong, printValue),
- TagInfo(0x002F, "WideFocusZone", "Wide Focus Zone", "Wide focus zone", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaWideFocusZoneStd), minoltaWideFocusZoneStd>),
- TagInfo(0x0030, "FocusMode", "Focus Mode", "Focus mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFocusModeStd), minoltaFocusModeStd>),
- TagInfo(0x0031, "FocusArea", "Focus area", "Focus area", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFocusAreaStd), minoltaFocusAreaStd>),
- TagInfo(0x0032, "DECPosition", "DEC Switch Position", "DEC switch position", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaDECPositionStd), minoltaDECPositionStd>),
- TagInfo(0x0033, "ColorProfile", "Color Profile", "Color profile", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaColorProfileStd), minoltaColorProfileStd>),
- TagInfo(0x0034, "DataImprint", "Data Imprint", "Data imprint", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaDataImprintStd), minoltaDataImprintStd>),
- TagInfo(0x003F, "FlashMetering", "Flash Metering", "Flash metering", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<COUNTOF(minoltaFlashMeteringStd), minoltaFlashMeteringStd>),
+ TagInfo(0x002F, "WideFocusZone", "Wide Focus Zone", "Wide focus zone", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaWideFocusZoneStd), minoltaWideFocusZoneStd>),
+ TagInfo(0x0030, "FocusMode", "Focus Mode", "Focus mode", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFocusModeStd), minoltaFocusModeStd>),
+ TagInfo(0x0031, "FocusArea", "Focus area", "Focus area", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFocusAreaStd), minoltaFocusAreaStd>),
+ TagInfo(0x0032, "DECPosition", "DEC Switch Position", "DEC switch position", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaDECPositionStd), minoltaDECPositionStd>),
+ TagInfo(0x0033, "ColorProfile", "Color Profile", "Color profile", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaColorProfileStd), minoltaColorProfileStd>),
+ TagInfo(0x0034, "DataImprint", "Data Imprint", "Data imprint", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaDataImprintStd), minoltaDataImprintStd>),
+ TagInfo(0x003F, "FlashMetering", "Flash Metering", "Flash metering", minoltaCsNewIfdId, makerTags, unsignedLong, printTag<EXV_COUNTOF(minoltaFlashMeteringStd), minoltaFlashMeteringStd>),
// End of list marker
TagInfo(0xffff, "(UnknownMinoltaCsTag)", "(UnknownMinoltaCsTag)", "Unknown Minolta Camera Settings tag", minoltaCsNewIfdId, makerTags, invalidTypeId, printValue)
@@ -646,34 +646,34 @@ namespace Exiv2 {
// Minolta Dynax 7D Camera Settings Tag Info
const TagInfo MinoltaMakerNote::tagInfoCs7D_[] = {
- TagInfo(0x0000, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaExposureMode7D), minoltaExposureMode7D>),
- TagInfo(0x0002, "ImageSize", "Image Size", "Image size", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageSize7D), minoltaImageSize7D>),
- TagInfo(0x0003, "Quality", "Image Quality", "Image quality", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageQuality7D), minoltaImageQuality7D>),
- TagInfo(0x0004, "WhiteBalance", "White Balance", "White balance", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaWhiteBalance7D), minoltaWhiteBalance7D>),
- TagInfo(0x000E, "FocusMode", "Focus Mode", "Focus mode", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaFocusMode7D), minoltaFocusMode7D>),
- TagInfo(0x0010, "AFPoints", "AF Points", "AF points", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaAFPoints7D), minoltaAFPoints7D>),
- TagInfo(0x0015, "Flash", "Flash", "Flash", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaFlash7D), minoltaFlash7D>),
+ TagInfo(0x0000, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaExposureMode7D), minoltaExposureMode7D>),
+ TagInfo(0x0002, "ImageSize", "Image Size", "Image size", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageSize7D), minoltaImageSize7D>),
+ TagInfo(0x0003, "Quality", "Image Quality", "Image quality", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageQuality7D), minoltaImageQuality7D>),
+ TagInfo(0x0004, "WhiteBalance", "White Balance", "White balance", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaWhiteBalance7D), minoltaWhiteBalance7D>),
+ TagInfo(0x000E, "FocusMode", "Focus Mode", "Focus mode", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaFocusMode7D), minoltaFocusMode7D>),
+ TagInfo(0x0010, "AFPoints", "AF Points", "AF points", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaAFPoints7D), minoltaAFPoints7D>),
+ TagInfo(0x0015, "Flash", "Flash", "Flash", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaFlash7D), minoltaFlash7D>),
TagInfo(0x0016, "FlashMode", "Flash Mode", "Flash mode", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
- TagInfo(0x001C, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaISOSetting7D), minoltaISOSetting7D>),
+ TagInfo(0x001C, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaISOSetting7D), minoltaISOSetting7D>),
TagInfo(0x001E, "ExposureCompensation", "Exposure Compensation", "Exposure compensation", minoltaCs7DIfdId, makerTags, signedShort, printValue),
- TagInfo(0x0025, "ColorSpace", "Color Space", "Color space", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaColorSpace7D), minoltaColorSpace7D>),
+ TagInfo(0x0025, "ColorSpace", "Color Space", "Color space", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaColorSpace7D), minoltaColorSpace7D>),
TagInfo(0x0026, "Sharpness", "Sharpness", "Sharpness", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0027, "Contrast", "Contrast", "Contrast", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0028, "Saturation", "Saturation", "Saturation", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x002D, "FreeMemoryCardImages", "Free Memory Card Images", "Free memory card images", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x003F, "ColorTemperature", "Color Temperature", "Color temperature", minoltaCs7DIfdId, makerTags, signedShort, printValue),
TagInfo(0x0040, "Hue", "Hue", "Hue", minoltaCsNewIfdId, makerTags, unsignedShort, printValue),
- TagInfo(0x0046, "Rotation", "Rotation", "Rotation", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaRotation7D), minoltaRotation7D>),
+ TagInfo(0x0046, "Rotation", "Rotation", "Rotation", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaRotation7D), minoltaRotation7D>),
TagInfo(0x0047, "FNumber", "FNumber", "FNumber", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0048, "ExposureTime", "Exposure Time", "Exposure time", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
// 0x004A is a dupplicate than 0x002D.
TagInfo(0x004A, "FreeMemoryCardImages", "Free Memory Card Images", "Free memory card images", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x005E, "ImageNumber", "Image Number", "Image number", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
- TagInfo(0x0060, "NoiseReduction", "Noise Reduction", "Noise reduction", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaNoiseReduction7D), minoltaNoiseReduction7D>),
+ TagInfo(0x0060, "NoiseReduction", "Noise Reduction", "Noise reduction", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaNoiseReduction7D), minoltaNoiseReduction7D>),
// 0x0062 is a dupplicate than 0x005E.
TagInfo(0x0062, "ImageNumber", "Image Number", "Image number", minoltaCs7DIfdId, makerTags, unsignedShort, printValue),
- TagInfo(0x0071, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageStabilization7D), minoltaImageStabilization7D>),
- TagInfo(0x0075, "ZoneMatchingOn", "Zone Matching On", "Zone matching on", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaZoneMatchingOn7D), minoltaZoneMatchingOn7D>),
+ TagInfo(0x0071, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageStabilization7D), minoltaImageStabilization7D>),
+ TagInfo(0x0075, "ZoneMatchingOn", "Zone Matching On", "Zone matching on", minoltaCs7DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaZoneMatchingOn7D), minoltaZoneMatchingOn7D>),
// End of list marker
TagInfo(0xffff, "(UnknownMinoltaCs7DTag)", "(UnknownMinoltaCs7DTag)", "Unknown Minolta Camera Settings 7D tag", minoltaCs7DIfdId, makerTags, invalidTypeId, printValue)
@@ -767,13 +767,13 @@ namespace Exiv2 {
// Minolta Dynax 5D Camera Settings Tag Info
const TagInfo MinoltaMakerNote::tagInfoCs5D_[] = {
- TagInfo(0x000A, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaExposureMode5D), minoltaExposureMode5D>),
- TagInfo(0x000C, "ImageSize", "Image Size", "Image size", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageSize5D), minoltaImageSize5D>),
- TagInfo(0x000D, "Quality", "Image Quality", "Image quality", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageQuality5D), minoltaImageQuality5D>),
- TagInfo(0x000E, "WhiteBalance", "White Balance", "White balance", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaWhiteBalance5D), minoltaWhiteBalance5D>),
- TagInfo(0x001F, "Flash", "Flash", "Flash", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaFlash5D), minoltaFlash5D>),
- TagInfo(0x0025, "MeteringMode", "Metering Mode", "Metering mode", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaMeteringMode5D), minoltaMeteringMode5D>),
- TagInfo(0x0026, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaISOSetting5D), minoltaISOSetting5D>),
+ TagInfo(0x000A, "ExposureMode", "Exposure Mode", "Exposure mode", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaExposureMode5D), minoltaExposureMode5D>),
+ TagInfo(0x000C, "ImageSize", "Image Size", "Image size", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageSize5D), minoltaImageSize5D>),
+ TagInfo(0x000D, "Quality", "Image Quality", "Image quality", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageQuality5D), minoltaImageQuality5D>),
+ TagInfo(0x000E, "WhiteBalance", "White Balance", "White balance", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaWhiteBalance5D), minoltaWhiteBalance5D>),
+ TagInfo(0x001F, "Flash", "Flash", "Flash", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaFlash5D), minoltaFlash5D>),
+ TagInfo(0x0025, "MeteringMode", "Metering Mode", "Metering mode", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaMeteringMode5D), minoltaMeteringMode5D>),
+ TagInfo(0x0026, "ISOSpeed", "ISO Speed Mode", "ISO speed setting", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaISOSetting5D), minoltaISOSetting5D>),
TagInfo(0x0030, "Sharpness", "Sharpness", "Sharpness", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0031, "Contrast", "Contrast", "Contrast", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0032, "Saturation", "Saturation", "Saturation", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
@@ -782,12 +782,12 @@ namespace Exiv2 {
TagInfo(0x0037, "FreeMemoryCardImages", "Free Memory Card Images", "Free memory card images", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0038, "ExposureRevision", "Exposure Revision", "Exposure revision", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0049, "ColorTemperature", "Color Temperature", "Color temperature", minoltaCs5DIfdId, makerTags, signedShort, printValue),
- TagInfo(0x0050, "Rotation", "Rotation", "Rotation", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaRotation5D), minoltaRotation5D>),
+ TagInfo(0x0050, "Rotation", "Rotation", "Rotation", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaRotation5D), minoltaRotation5D>),
TagInfo(0x0053, "ExposureCompensation", "Exposure Compensation", "Exposure compensation", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0054, "FreeMemoryCardImages", "Free Memory Card Images", "Free memory card images", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x00AE, "ImageNumber", "Image Number", "Image number", minoltaCs5DIfdId, makerTags, unsignedShort, printValue),
- TagInfo(0x00B0, "NoiseReduction", "Noise Reduction", "Noise reduction", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaNoiseReduction5D), minoltaNoiseReduction5D>),
- TagInfo(0x00BD, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<COUNTOF(minoltaImageStabilization5D), minoltaImageStabilization5D>),
+ TagInfo(0x00B0, "NoiseReduction", "Noise Reduction", "Noise reduction", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaNoiseReduction5D), minoltaNoiseReduction5D>),
+ TagInfo(0x00BD, "ImageStabilization", "Image Stabilization", "Image stabilization", minoltaCs5DIfdId, makerTags, unsignedShort, printTag<EXV_COUNTOF(minoltaImageStabilization5D), minoltaImageStabilization5D>),
// End of list marker
TagInfo(0xffff, "(UnknownMinoltaCs5DTag)", "(UnknownMinoltaCs5DTag)", "Unknown Minolta Camera Settings 5D tag", minoltaCs5DIfdId, makerTags, invalidTypeId, printValue)
diff --git a/src/minoltamn.hpp b/src/minoltamn.hpp
index 1c58cbe..fea025d 100644
--- a/src/minoltamn.hpp
+++ b/src/minoltamn.hpp
@@ -20,11 +20,11 @@
*/
/*!
@file minoltamn.hpp
- @brief Minolta MakerNote implemented using the following references:
- <a href="http://www.dalibor.cz/minolta/makernote.htm">Minolta Makernote Format Specification</a> by Dalibor Jelinek,
- <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Minolta.html">Minolta Makernote list by Phil Harvey</a>
- <a href="http://www.ozhiker.com/electronics/pjmt/jpeg_info/minolta_mn.html">Minolta Makernote list from PHP JPEG Metadata Toolkit</a>
- email communication with <a href="mailto:caulier dot gilles at kdemail dot net">caulier dot gilles at kdemail dot net</a>
+ @brief Minolta MakerNote implemented using the following references:<br>
+ <a href="http://www.dalibor.cz/minolta/makernote.htm">Minolta Makernote Format Specification</a> by Dalibor Jelinek,<br>
+ <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Minolta.html">Minolta Makernote list</a> by Phil Harvey<br>
+ <a href="http://www.ozhiker.com/electronics/pjmt/jpeg_info/minolta_mn.html">Minolta Makernote list from PHP JPEG Metadata Toolkit</a><br>
+ Email communication with <a href="mailto:caulier dot gilles at kdemail dot net">caulier dot gilles at kdemail dot net</a><br>
@version $Rev$
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index 877fc7d..8944028 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -50,6 +50,57 @@ EXIV2_RCSID("@(#) $Id$");
// class member definitions
namespace Exiv2 {
+ //! Structure for group and group name info
+ struct TiffGroupInfo {
+ //! comparison operator
+ bool operator==(uint16_t group) const;
+
+ uint16_t group_; //!< group
+ const char* name_; //!< group name
+ };
+
+ // Todo: This mapping table probably still belongs somewhere else
+ //! List of groups and their names
+ extern const TiffGroupInfo tiffGroupInfo[] = {
+ { 1, "Image" },
+ { 2, "Thumbnail" },
+ { 3, "Photo" },
+ { 4, "GPSInfo" },
+ { 5, "Iop" },
+ { 257, "Olympus" },
+ { 258, "Fujifilm" },
+ { 259, "Canon" },
+ { 260, "CanonCs1" },
+ { 261, "CanonCs2" },
+ { 262, "CanonCf" },
+ // 263 not needed (nikonmn)
+ { 264, "Nikon1" },
+ { 265, "Nikon2" },
+ { 266, "Nikon3" },
+ { 267, "Panasonic" },
+ { 268, "Sigma" },
+ // 269 not needed (sonymn)
+ { 270, "Sony" },
+ { 271, "Sony" },
+ { 272, "Minolta" },
+ { 273, "MinoltaCsOld" },
+ { 274, "MinoltaCsNew" },
+ { 275, "MinoltaCs5D" },
+ { 276, "MinoltaCs7D" }
+ };
+
+ bool TiffGroupInfo::operator==(uint16_t group) const
+ {
+ return group_ == group;
+ }
+
+ const char* tiffGroupName(uint16_t group)
+ {
+ const TiffGroupInfo* gi = find(tiffGroupInfo, group);
+ if (!gi) return "Unknown";
+ return gi->name_;
+ }
+
bool TiffStructure::operator==(const TiffStructure::Key& key) const
{
return key.e_ == extendedTag_ && key.g_ == group_
@@ -88,40 +139,10 @@ namespace Exiv2 {
}
} // TiffArrayEntry::~TiffArrayEntry
+ // Possibly this function shouldn't be in this class...
std::string TiffComponent::groupName() const
{
- // Todo: This mapping should be a table and it belongs somewhere else
- // Possibly the whole function shouldn't be in this class...
- std::string group;
- switch (group_) {
- case 1: group = "Image"; break;
- case 2: group = "Thumbnail"; break;
- case 3: group = "Photo"; break;
- case 4: group = "GPSInfo"; break;
- case 5: group = "Iop"; break;
- case 257: group = "Olympus"; break;
- case 258: group = "Fujifilm"; break;
- case 259: group = "Canon"; break;
- case 260: group = "CanonCs1"; break;
- case 261: group = "CanonCs2"; break;
- case 262: group = "CanonCf"; break;
- // 263 not needed (nikonmn)
- case 264: group = "Nikon1"; break;
- case 265: group = "Nikon2"; break;
- case 266: group = "Nikon3"; break;
- case 267: group = "Panasonic"; break;
- case 268: group = "Sigma"; break;
- // 269 not needed (sonymn)
- case 270: group = "Sony"; break;
- case 271: group = "Sony"; break;
- case 272: group = "Minolta"; break;
- case 273: group = "MinoltaCsOld"; break;
- case 274: group = "MinoltaCsNew"; break;
- case 275: group = "MinoltaCs5D"; break;
- case 276: group = "MinoltaCs7D"; break;
- default: group = "Unknown"; break;
- }
- return group;
+ return tiffGroupName(group_);
}
void TiffComponent::addChild(TiffComponent::AutoPtr tiffComponent)
diff --git a/src/tiffcomposite.hpp b/src/tiffcomposite.hpp
index d8364bb..ac3322f 100644
--- a/src/tiffcomposite.hpp
+++ b/src/tiffcomposite.hpp
@@ -72,6 +72,7 @@ namespace Exiv2 {
const uint16_t exif = 3; //!< Exif IFD
const uint16_t gps = 4; //!< GPS IFD
const uint16_t iop = 5; //!< Interoperability IFD
+ const uint16_t sub0_0 = 6; //!< Tiff SubIFD in IFD0
const uint16_t mn = 256; //!< Makernote
const uint16_t ignr = 511; //!< Read but do not decode
}
@@ -557,6 +558,9 @@ namespace Exiv2 {
// *****************************************************************************
// template, inline and free functions
+ //! Return the group name for a group
+ const char* tiffGroupName(uint16_t group);
+
//! Function to create and initialize a new TIFF directory
TiffComponent::AutoPtr newTiffDirectory(uint16_t tag,
const TiffStructure* ts);
diff --git a/src/tiffparser.cpp b/src/tiffparser.cpp
index 54fdc2f..fa1c692 100644
--- a/src/tiffparser.cpp
+++ b/src/tiffparser.cpp
@@ -97,7 +97,6 @@ namespace Exiv2 {
{ Tag::root, Group::none, newTiffDirectory, Group::ifd0 },
{ 0x8769, Group::ifd0, newTiffSubIfd, Group::exif },
{ 0x8825, Group::ifd0, newTiffSubIfd, Group::gps },
- { 0x014a, Group::ifd0, newTiffSubIfd, Group::ignr }, // todo: better support
{ 0xa005, Group::exif, newTiffSubIfd, Group::iop },
{ 0x927c, Group::exif, newTiffMnEntry, Group::mn },
{ 0x0201, Group::ifd1, newTiffThumbData, Group::ifd1 },
@@ -105,6 +104,8 @@ namespace Exiv2 {
{ Tag::next, Group::ifd0, newTiffDirectory, Group::ifd1 },
{ Tag::next, Group::ifd1, newTiffDirectory, Group::ignr },
{ Tag::next, Group::ignr, newTiffDirectory, Group::ignr },
+ // SubIfd found in NEF images
+ { 0x014a, Group::ifd0, newTiffSubIfd, Group::sub0_0 },
// Canon makernote structure
{ 0x0001, Group::canonmn, newTiffArrayEntry<2>, Group::canoncs },
{ 0x0004, Group::canonmn, newTiffArrayEntry<2>, Group::canonsi },
@@ -161,7 +162,7 @@ namespace Exiv2 {
TiffReader reader(pData, size, rootDir.get(), state);
rootDir->accept(reader);
- TiffMetadataDecoder decoder(pImage, 4096);
+ TiffMetadataDecoder decoder(pImage, rootDir.get(), 4096);
rootDir->accept(decoder);
} // TiffParser::decode
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index 8962400..4928dc7 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -53,6 +53,21 @@ EXIV2_RCSID("@(#) $Id$");
// class member definitions
namespace Exiv2 {
+ // TIFF Decoder table for special decoding requirements
+ const TiffDecoderInfo TiffMetadataDecoder::tiffDecoderInfo_[] = {
+ { "*", Tag::all, Group::ignr, 0 }, // Do not decode tags with group == Group::ignr
+ { "OLYMPUS", 0x0100, Group::olympmn, &TiffMetadataDecoder::decodeOlympThumb }
+// { "NIKON", 0x0100, Group::sub0_0, &TiffMetadataDecoder::decodeTo<0x0100, Group::ifd0> }
+ };
+
+ bool TiffDecoderInfo::operator==(const TiffDecoderInfo::Key& key) const
+ {
+ std::string make(make_);
+ return ("*" == make || make == key.m_.substr(0, make.length()))
+ && (Tag::all == extendedTag_ || key.e_ == extendedTag_)
+ && key.g_ == group_;
+ }
+
void TiffFinder::init(uint16_t tag, uint16_t group)
{
tag_ = tag;
@@ -113,6 +128,20 @@ namespace Exiv2 {
findObject(object);
}
+ TiffMetadataDecoder::TiffMetadataDecoder(Image* pImage,
+ TiffComponent* const pRoot,
+ uint32_t threshold)
+ : pImage_(pImage), pRoot_(pRoot), threshold_(threshold)
+ {
+ // Find camera make
+ TiffFinder finder(0x010f, Group::ifd0);
+ pRoot_->accept(finder);
+ TiffEntryBase* te = dynamic_cast<TiffEntryBase*>(finder.result());
+ if (te && te->pValue()) {
+ make_ = te->pValue()->toString();
+ }
+ }
+
void TiffMetadataDecoder::visitEntry(TiffEntry* object)
{
decodeTiffEntry(object);
@@ -148,51 +177,65 @@ namespace Exiv2 {
// Nothing to do
}
+ void TiffMetadataDecoder::decodeOlympThumb(const TiffEntryBase* object)
+ {
+ const DataValue* v = dynamic_cast<const DataValue*>(object->pValue());
+ if (v != 0) {
+ ExifData& exifData = pImage_->exifData();
+ exifData["Exif.Thumbnail.Compression"] = uint16_t(6);
+ DataBuf buf(v->size());
+ v->copy(buf.pData_);
+ Exifdatum& ed = exifData["Exif.Thumbnail.JPEGInterchangeFormat"];
+ ed = uint32_t(0);
+ ed.setDataArea(buf.pData_, buf.size_);
+ exifData["Exif.Thumbnail.JPEGInterchangeFormatLength"] = uint32_t(buf.size_);
+ }
+ }
+
void TiffMetadataDecoder::decodeTiffEntry(const TiffEntryBase* object)
{
assert(object != 0);
+ const TiffDecoderInfo* td = find(tiffDecoderInfo_,
+ TiffDecoderInfo::Key(make_, object->tag(), object->group()));
- if (object->group() == Group::ignr) return;
-
- // Experimental code to decode Olympus Thumbnail from the TIFF makernote
- // into IFD1.
- // Todo: this should go elsewhere. Ideally, such code to decode specific
- // tag/group combinations could be added from outside
- if (object->tag() == 0x0100 && object->group() == 257) {
- const DataValue* v = dynamic_cast<const DataValue*>(object->pValue());
- if (v != 0) {
- ExifData& exifData = pImage_->exifData();
- exifData["Exif.Thumbnail.Compression"] = uint16_t(6);
- DataBuf buf(v->size());
- v->copy(buf.pData_);
- Exifdatum& ed = exifData["Exif.Thumbnail.JPEGInterchangeFormat"];
- ed = uint32_t(0);
- ed.setDataArea(buf.pData_, buf.size_);
- exifData["Exif.Thumbnail.JPEGInterchangeFormatLength"] = uint32_t(buf.size_);
- return;
+ if (td) {
+ // skip decoding if td->decoderFct_ == 0
+ if (td->decoderFct_) {
+ EXV_CALL_MEMBER_FN(*this, td->decoderFct_)(object);
}
+ return;
}
-
+ assert(pImage_ != 0);
+ // "Normal" tag has low priority: only decode if it doesn't exist yet.
// Todo: ExifKey should have an appropriate c'tor, it should not be
// necessary to use groupName here
- ExifKey k(object->tag(), object->groupName());
- const Value* v = object->pValue();
- if ( threshold_ > 0
- && v != 0
- && static_cast<uint32_t>(v->size()) > threshold_
- && k.tagName().substr(0, 2) == "0x") {
+ ExifKey key(object->tag(), object->groupName());
+ // Todo: Too much searching here, optimize when threshold goes.
+ if (pImage_->exifData().findKey(key) == pImage_->exifData().end()) {
+ setExifTag(key, object->pValue());
+ }
+ } // TiffMetadataDecoder::decodeTiffEntry
+
+ void TiffMetadataDecoder::setExifTag(const ExifKey& key, const Value* pValue)
+ {
+ if ( threshold_ > 0
+ && pValue != 0
+ && static_cast<uint32_t>(pValue->size()) > threshold_
+ && key.tagName().substr(0, 2) == "0x") {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: "
- << "Size " << v->size() << " of " << k.key()
+ << "Size " << pValue->size() << " of " << key.key()
<< " exceeds " << threshold_
<< " bytes limit. Not decoded.
";
#endif
return;
}
assert(pImage_ != 0);
- pImage_->exifData().add(k, object->pValue());
+ ExifData::iterator pos = pImage_->exifData().findKey(key);
+ if (pos != pImage_->exifData().end()) pImage_->exifData().erase(pos);
+ pImage_->exifData().add(key, pValue);
- } // TiffMetadataDecoder::decodeTiffEntry
+ } // TiffMetadataDecoder::addExifTag
void TiffMetadataDecoder::visitArrayEntry(TiffArrayEntry* object)
{
diff --git a/src/tiffvisitor.hpp b/src/tiffvisitor.hpp
index ee301e0..ce73d68 100644
--- a/src/tiffvisitor.hpp
+++ b/src/tiffvisitor.hpp
@@ -33,6 +33,7 @@
// included header files
#include "types.hpp"
#include "tiffcomposite.hpp"
+#include "exif.hpp"
// + standard includes
#include <memory>
@@ -194,6 +195,41 @@ namespace Exiv2 {
TiffComponent* tiffComponent_;
}; // class TiffFinder
+ //! Function pointer type for a function to decode a TIFF component.
+ typedef void (TiffMetadataDecoder::*DecoderFct)(const TiffEntryBase*);
+
+ //! TIFF decoder table
+ struct TiffDecoderInfo {
+ struct Key;
+ /*!
+ @brief Compare a TiffDecoderInfo with a TiffDecoderInfo::Key.
+ The two are equal if TiffDecoderInfo::make_ equals a substring
+ of the key of the same size. E.g., decoder info = "OLYMPUS",
+ key = "OLYMPUS OPTICAL CO.,LTD" (found in the image) match,
+ the extendedTag is Tag::all or equal to the extended tag of the
+ key, and the group is equal to that of the key.
+ */
+ bool operator==(const Key& key) const;
+ //! Return the tag corresponding to the extended tag
+ uint16_t tag() const { return static_cast<uint16_t>(extendedTag_ & 0xffff); }
+
+ // DATA
+ const char* make_; //!< Camera make for which this decoder function applies
+ uint32_t extendedTag_; //!< Tag (32 bit so that it can contain special tags)
+ uint16_t group_; //!< Group that contains the tag
+ DecoderFct decoderFct_; //!< Decoder function for matching tags
+
+ }; // struct TiffDecoderInfo
+
+ //! Search key for TIFF decoder structures.
+ struct TiffDecoderInfo::Key {
+ //! Constructor
+ Key(const std::string& m, uint32_t e, uint16_t g) : m_(m), e_(e), g_(g) {}
+ std::string m_; //!< Camera make
+ uint32_t e_; //!< Extended tag
+ uint16_t g_; //!< %Group
+ };
+
/*!
@brief TIFF composite visitor to decode metadata from the TIFF tree and
add it to an Image, which is supplied in the constructor (Visitor
@@ -205,13 +241,15 @@ namespace Exiv2 {
//! @name Creators
//@{
/*!
- Constructor, taking the image to add the metadata to
- and an optional threshold. Unknown tags with values
- larger (in bytes) than the threshold will be ignored.
- Default is not to ignore any tags (0).
+ @brief Constructor, taking the image to add the metadata to, the root
+ element of the composite to decode and an optional
+ threshold. Unknown tags with values larger (in bytes) than the
+ threshold will be ignored. Default is not to ignore any
+ tags (0).
*/
- TiffMetadataDecoder(Image* pImage, uint32_t threshold =0)
- : pImage_(pImage), threshold_(threshold) {}
+ TiffMetadataDecoder(Image* pImage,
+ TiffComponent* const pRoot,
+ uint32_t threshold =0);
//! Virtual destructor
virtual ~TiffMetadataDecoder() {}
//@}
@@ -239,12 +277,25 @@ namespace Exiv2 {
//! Decode a standard TIFF entry
void decodeTiffEntry(const TiffEntryBase* object);
+ //! Decode Olympus Thumbnail from the TIFF makernote into IFD1
+ void decodeOlympThumb(const TiffEntryBase* object);
+ //! Decode object to the Exif entry tag, group
+ template<uint16_t tag, uint16_t group>
+ void decodeTo(const TiffEntryBase* object);
//@}
private:
+ //! Set an Exif tag in the image. Overwrites existing tags
+ void setExifTag(const ExifKey& key, const Value* pValue);
+
// DATA
- Image* pImage_; //!< Pointer to the image to which the metadata is added
- const uint32_t threshold_; //!< Threshold, see constructor documentation.
+ Image* pImage_; //!< Pointer to the image to which the metadata is added
+ TiffComponent* const pRoot_; //!< Root element of the composite
+ const uint32_t threshold_; //!< Threshold, see constructor documentation.
+ std::string make_; //!< Camera make, determined from the tags to decode
+
+ static const TiffDecoderInfo tiffDecoderInfo_[]; //<! TIFF decoder table
+
}; // class TiffMetadataDecoder
/*!
@@ -448,6 +499,19 @@ namespace Exiv2 {
static const std::string indent_; //!< Indent for one level
}; // class TiffPrinter
+// *****************************************************************************
+// template, inline and free functions
+
+ template<uint16_t tag, uint16_t group>
+ void TiffMetadataDecoder::decodeTo(const TiffEntryBase* object)
+ {
+ assert(object);
+ // Todo: ExifKey should have an appropriate c'tor, it should not be
+ // necessary to use groupName here
+ ExifKey key(tag, tiffGroupName(group));
+ setExifTag(key, object->pValue());
+ }
+
} // namespace Exiv2
#endif // #ifndef TIFFVISITOR_HPP_
diff --git a/src/types.hpp b/src/types.hpp
index 078417e..b170c79 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -58,6 +58,13 @@ typedef __int16 int16_t;
typedef __int32 int32_t;
#endif
+/*!
+ @brief Macro to make calls to member functions through a pointer more readable.
+ See the C++ FAQ LITE, item
+ <a href="http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.5" title="[33.5] How can I avoid syntax errors when calling a member function using a pointer-to-member-function?">[33.5] How can I avoid syntax errors when calling a member function using a pointer-to-member-function?</a>.
+ */
+#define EXV_CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
+
// *****************************************************************************
// forward declarations
struct tm;
@@ -358,7 +365,7 @@ namespace Exiv2 {
//! Template used in the COUNTOF macro to determine the size of an array
template <typename T, int N> char (&sizer(T (&)[N]))[N];
//! Macro to determine the size of an array
-#define COUNTOF(a) (sizeof(sizer(a)))
+#define EXV_COUNTOF(a) (sizeof(sizer(a)))
//! Utility function to convert the argument of any type to a string
template<typename T>
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list