From b02c80f7e4fb0896ab6df6ac9af6f2521308932b Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 7 Jun 2019 17:41:56 +0100 Subject: [PATCH 1/5] fix646_NikonAF22 --- src/makernote_int.cpp | 9 +++ src/makernote_int.hpp | 11 ++++ src/nikonmn_int.cpp | 72 +++++++++++++++-------- src/nikonmn_int.hpp | 8 ++- src/tags_int.cpp | 3 +- src/tags_int.hpp | 3 +- src/tiffimage_int.cpp | 51 +++++++++++++--- src/tiffvisitor_int.cpp | 7 ++- test/data/_DSC8437.exv | Bin 0 -> 11372 bytes tests/bugfixes/redmine/test_issue_646.py | 29 +++++++++ 10 files changed, 156 insertions(+), 37 deletions(-) create mode 100644 test/data/_DSC8437.exv create mode 100644 tests/bugfixes/redmine/test_issue_646.py diff --git a/src/makernote_int.cpp b/src/makernote_int.cpp index 092cf90e..20cd7629 100644 --- a/src/makernote_int.cpp +++ b/src/makernote_int.cpp @@ -1185,6 +1185,15 @@ namespace Exiv2 { return aix == 0 ? -1 : aix->idx_; } + int nikonAf2Selector(uint16_t tag, const byte* /*pData*/, uint32_t size, TiffComponent* const /*pRoot*/) + { + int result = tag == 0x00b7 ? 0 : -1 ; + if (result > -1 && size == 84 ) { + result = 1; + } + return result; + } + DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot) { DataBuf buf; diff --git a/src/makernote_int.hpp b/src/makernote_int.hpp index a348260e..4acd055f 100644 --- a/src/makernote_int.hpp +++ b/src/makernote_int.hpp @@ -741,6 +741,17 @@ namespace Exiv2 { */ int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot); + /*! + @brief Function to select cfg + def of a Nikon complex binary array. + + @param tag Tag number of the binary array + @param pData Pointer to the raw array data. + @param size Size of the array data. + @param pRoot Pointer to the root component of the TIFF tree. + @return An index into the array set, -1 if no match was found. + */ + int nikonAf2Selector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot); + /*! @brief Encrypt and decrypt Nikon data. diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index 4def0e56..97d498f1 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -888,31 +888,57 @@ namespace Exiv2 { { 6, N_("On (105-point)") } }; - // Nikon3 Auto Focus Tag Info - const TagInfo Nikon3MakerNote::tagInfoAf2_[] = { - TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf2Id, makerTags, undefined, 4, printExifVersion), - TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf2Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), - TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf2Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf2Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), - TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf2Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf2Id, makerTags, unsignedByte, 7, printValue), - TagInfo( 16, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 18, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 20, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 22, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 24, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 26, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 28, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf2Id, makerTags, unsignedShort, 1, printValue), - // End of list marker - TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf2Id, makerTags, unsignedByte, 1, printValue) - }; - const TagInfo* Nikon3MakerNote::tagListAf2() - { - return tagInfoAf2_; - } + // Nikon3 Auto Focus Tag Info + const TagInfo Nikon3MakerNote::tagInfoAf21_[] = { + TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf21Id, makerTags, undefined, 4, printExifVersion), + TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), + TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), + TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf21Id, makerTags, unsignedByte, 7, printValue), + TagInfo( 16, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 18, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 20, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 22, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 24, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 26, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 28, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + // End of list marker + TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf21Id, makerTags, unsignedByte, 1, printValue) + }; - // Nikon3 File Info Tag Info + const TagInfo* Nikon3MakerNote::tagListAf21() + { + return tagInfoAf21_; + } + + // Nikon3 Auto Focus Tag Info + const TagInfo Nikon3MakerNote::tagInfoAf22_[] = { + TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf22Id, makerTags, undefined, 4, printExifVersion), + TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), + TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), + TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf22Id, makerTags, unsignedByte, 7, printValue), + TagInfo( 70, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 72, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 74, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 76, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 78, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 80, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 82, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + // End of list marker + TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf22Id, makerTags, unsignedByte, 1, printValue) + }; + + const TagInfo* Nikon3MakerNote::tagListAf22() + { + return tagInfoAf22_; + } + + + // Nikon3 File Info Tag Info const TagInfo Nikon3MakerNote::tagInfoFi_[] = { TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonFiId, makerTags, undefined, 4, printExifVersion), TagInfo( 6, "DirectoryNumber", N_("Directory Number"), N_("Directory number"), nikonFiId, makerTags, unsignedShort, 1, printValue), diff --git a/src/nikonmn_int.hpp b/src/nikonmn_int.hpp index 45a3cdbd..cdac89c0 100644 --- a/src/nikonmn_int.hpp +++ b/src/nikonmn_int.hpp @@ -124,7 +124,9 @@ namespace Exiv2 { //! Return read-only list of built-in Auto Focus tags static const TagInfo* tagListAf(); //! Return read-only list of built-in Auto Focus 2 tags - static const TagInfo* tagListAf2(); + static const TagInfo* tagListAf21(); + //! Return read-only list of built-in Auto Focus 2 tags + static const TagInfo* tagListAf22(); //! Return read-only list of built-in AF Fine Tune tags static const TagInfo* tagListAFT(); //! Return read-only list of built-in File Info tags @@ -235,7 +237,9 @@ namespace Exiv2 { //! Auto Focus tag information static const TagInfo tagInfoAf_[]; //! Auto Focus tag 2 information - static const TagInfo tagInfoAf2_[]; + static const TagInfo tagInfoAf21_[]; + //! Auto Focus tag 2 information + static const TagInfo tagInfoAf22_[]; //! AF Fine Tune tag information static const TagInfo tagInfoAFT_[]; //! File Info tag information diff --git a/src/tags_int.cpp b/src/tags_int.cpp index 902c7f52..c07aa364 100644 --- a/src/tags_int.cpp +++ b/src/tags_int.cpp @@ -106,7 +106,8 @@ namespace Exiv2 { { nikonWtId, "Makernote", "NikonWt", Nikon3MakerNote::tagListWt }, { nikonIiId, "Makernote", "NikonIi", Nikon3MakerNote::tagListIi }, { nikonAfId, "Makernote", "NikonAf", Nikon3MakerNote::tagListAf }, - { nikonAf2Id, "Makernote", "NikonAf2", Nikon3MakerNote::tagListAf2 }, + { nikonAf21Id, "Makernote", "NikonAf2", Nikon3MakerNote::tagListAf21 }, + { nikonAf22Id, "Makernote", "NikonAf22", Nikon3MakerNote::tagListAf22 }, { nikonAFTId, "Makernote", "NikonAFT", Nikon3MakerNote::tagListAFT }, { nikonFiId, "Makernote", "NikonFi", Nikon3MakerNote::tagListFi }, { nikonMeId, "Makernote", "NikonMe", Nikon3MakerNote::tagListMe }, diff --git a/src/tags_int.hpp b/src/tags_int.hpp index 91337e5b..eaa8baf9 100644 --- a/src/tags_int.hpp +++ b/src/tags_int.hpp @@ -99,7 +99,8 @@ namespace Exiv2 { nikonWtId, nikonIiId, nikonAfId, - nikonAf2Id, + nikonAf21Id, + nikonAf22Id, nikonAFTId, nikonFiId, nikonMeId, diff --git a/src/tiffimage_int.cpp b/src/tiffimage_int.cpp index c5aa3565..339c0ade 100644 --- a/src/tiffimage_int.cpp +++ b/src/tiffimage_int.cpp @@ -221,9 +221,9 @@ namespace Exiv2 { { 2, ttUnsignedShort, 1 } // The array contains 4 bytes }; - //! Nikon Auto Focus 2 binary array - configuration - extern const ArrayCfg nikonAf2Cfg = { - nikonAf2Id, // Group for the elements + //! Nikon Auto Focus 21 binary array - configuration + extern const ArrayCfg nikonAf21Cfg = { + nikonAf21Id, // Group for the elements invalidByteOrder, // Use byte order from parent ttUndefined, // Type for array entry notEncrypted, // Not encrypted @@ -232,8 +232,8 @@ namespace Exiv2 { true, // Concatenate gaps { 0, ttUnsignedByte, 1 } }; - //! Nikon Auto Focus 2 binary array - definition - extern const ArrayDef nikonAf2Def[] = { + //! Nikon Auto Focus 21 binary array - definition + extern const ArrayDef nikonAf21Def[] = { { 0, ttUndefined, 4 }, // Version { 4, ttUnsignedByte, 1 }, // ContrastDetectAF { 5, ttUnsignedByte, 1 }, // AFAreaMode @@ -248,6 +248,39 @@ namespace Exiv2 { { 26, ttUnsignedShort, 1 }, // AFAreaHeight { 28, ttUnsignedShort, 1 }, // ContrastDetectAFInFocus }; + //! Nikon Auto Focus 22 binary array - configuration + extern const ArrayCfg nikonAf22Cfg = { + nikonAf22Id, // Group for the elements + littleEndian, // Byte order + ttUndefined, // Type for array entry + notEncrypted, // Not encrypted + false, // No size element + true, // Write all tags + true, // Concatenate gaps + { 0, ttUnsignedByte, 1 } + }; + //! Nikon Auto Focus 22 binary array - definition + extern const ArrayDef nikonAf22Def[] = { + { 0, ttUndefined, 4 }, // Version + { 4, ttUnsignedByte, 1 }, // ContrastDetectAF + { 5, ttUnsignedByte, 1 }, // AFAreaMode + { 6, ttUnsignedByte, 1 }, // PhaseDetectAF + { 7, ttUnsignedByte, 1 }, // PrimaryAFPoint + { 8, ttUnsignedByte, 7 }, // AFPointsUsed + { 70, ttUnsignedShort, 1 }, // AFImageWidth + { 72, ttUnsignedShort, 1 }, // AFImageHeight + { 74, ttUnsignedShort, 1 }, // AFAreaXPosition + { 76, ttUnsignedShort, 1 }, // AFAreaYPosition + { 78, ttUnsignedShort, 1 }, // AFAreaWidth + { 80, ttUnsignedShort, 1 }, // AFAreaHeight + }; + + //! Nikon AF2 configuration and definitions + // https://github.com/Exiv2/exiv2/issues/646 + extern const ArraySet nikonAf2Set[] = { + { nikonAf21Cfg, nikonAf21Def, EXV_COUNTOF(nikonAf21Def) }, + { nikonAf22Cfg, nikonAf22Def, EXV_COUNTOF(nikonAf22Def) }, + }; //! Nikon AF Fine Tune binary array - configuration extern const ArrayCfg nikonAFTCfg = { @@ -932,7 +965,8 @@ namespace Exiv2 { { Tag::root, nikonLd2Id, nikon3Id, 0x0098 }, { Tag::root, nikonLd3Id, nikon3Id, 0x0098 }, { Tag::root, nikonMeId, nikon3Id, 0x00b0 }, - { Tag::root, nikonAf2Id, nikon3Id, 0x00b7 }, + { Tag::root, nikonAf21Id, nikon3Id, 0x00b7 }, + { Tag::root, nikonAf22Id, nikon3Id, 0x00b7 }, { Tag::root, nikonFiId, nikon3Id, 0x00b8 }, { Tag::root, nikonAFTId, nikon3Id, 0x00b9 }, { Tag::root, nikonFl1Id, nikon3Id, 0x00a8 }, @@ -1274,7 +1308,7 @@ namespace Exiv2 { { 0x0098, nikon3Id, EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, nikonSelector) }, { 0x00a8, nikon3Id, EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, nikonSelector) }, { 0x00b0, nikon3Id, EXV_BINARY_ARRAY(nikonMeCfg, nikonMeDef) }, - { 0x00b7, nikon3Id, EXV_BINARY_ARRAY(nikonAf2Cfg, nikonAf2Def)}, + { 0x00b7, nikon3Id, EXV_COMPLEX_BINARY_ARRAY(nikonAf2Set, nikonAf2Selector) }, { 0x00b8, nikon3Id, EXV_BINARY_ARRAY(nikonFiCfg, nikonFiDef) }, { 0x00b9, nikon3Id, EXV_BINARY_ARRAY(nikonAFTCfg, nikonAFTDef) }, { Tag::all, nikon3Id, newTiffEntry }, @@ -1301,7 +1335,8 @@ namespace Exiv2 { { Tag::all, nikonAfId, newTiffBinaryElement }, // Nikon3 auto focus 2 - { Tag::all, nikonAf2Id, newTiffBinaryElement }, + { Tag::all, nikonAf21Id, newTiffBinaryElement }, + { Tag::all, nikonAf22Id, newTiffBinaryElement }, // Nikon3 AF Fine Tune { Tag::all, nikonAFTId, newTiffBinaryElement }, diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index b633a96a..98a38c1d 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -473,7 +473,11 @@ namespace Exiv2 { object->group()); // skip decoding if decoderFct == 0 if (decoderFct) { - EXV_CALL_MEMBER_FN(*this, decoderFct)(object); + if ( object->group() == nikonAf22Id ) { + EXV_CALL_MEMBER_FN(*this, decoderFct)(object); + } else { + EXV_CALL_MEMBER_FN(*this, decoderFct)(object); + } } } // TiffDecoder::decodeTiffEntry @@ -1582,7 +1586,6 @@ namespace Exiv2 { postList_.push_back(object); return; } - // Check duplicates TiffFinder finder(object->tag(), object->group()); pRoot_->accept(finder); diff --git a/test/data/_DSC8437.exv b/test/data/_DSC8437.exv new file mode 100644 index 0000000000000000000000000000000000000000..d55a68690d3f18c8ae931a6e5440f1fb6164f1c9 GIT binary patch literal 11372 zcmeHN2UJwo*1j{+v0wuW>M)1}fw>GQMQMU47EmM>qA2JnNG}3n?+p>Lw^%S1Y}mWl zJ9ZO|u|*{@vBq9rc;CLW(UHZA$$M|T^{@4F$C>Zj`<}Z`+57B$9Hv;-COs-uU3^Em z0c3z61O(U$MuH%i3x5cDf((q_f=tVo5@ntaE|*mhDge#Vr~-IN`zkWIPz`!ZD9pf3 z!5zS>>9ncIoSv^E)0dugN1M9LTZ3Ebv~R*(j`ohQX##AIHfr!1;342G!EL}J!E4C% z1q1Lb@Ofk8f(!V5@TiH}xtPF^%_J?KrNsENwRT>ijd_j?v*)=3jigs#K!>0}g>O)B z=b&Jpkbs~-L96j|Z7vFe9iGF#kJwF<EV?^83!S3+ zMTTo)6kQz@J~1(|;c;L1s# zJl&YNH%y7l$wO*hS<;uR?0Gz^$E$n~+zi|h_uqh5WlqapjkyuHUXF=0V>5959PM~& zfg9#%$DohrjhKT9#yZ@D+bht1SdO9KT3-;FfK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}Qc+t+7*Jy9s=TU*DnMofD8%gBFr(f7)6Ra{KB$Rc5k zzSX7g;$ABLGpqlLr|Da7{8>l(d(I;KO~{w3UPs?O-T0ZUXG34~65w7Ap z#+xEjQWD%%s<>o_@c!`;8i#)Iv8wd&1QmXBp%Pkor6+{i0 Date: Fri, 7 Jun 2019 18:39:45 +0100 Subject: [PATCH 2/5] Simplification of TiffDecoder::decodeTiffEntry(). --- src/tiffvisitor_int.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index 98a38c1d..c98a1c31 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -473,11 +473,7 @@ namespace Exiv2 { object->group()); // skip decoding if decoderFct == 0 if (decoderFct) { - if ( object->group() == nikonAf22Id ) { - EXV_CALL_MEMBER_FN(*this, decoderFct)(object); - } else { - EXV_CALL_MEMBER_FN(*this, decoderFct)(object); - } + EXV_CALL_MEMBER_FN(*this, decoderFct)(object); } } // TiffDecoder::decodeTiffEntry From b6f82a8f5807a0d36d2b473fb67dec958a8ff559 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 7 Jun 2019 22:04:57 +0100 Subject: [PATCH 3/5] Change byte order in nikonAf22Cfg to invalidByteOrder (see #880 and #885). --- src/tiffimage_int.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tiffimage_int.cpp b/src/tiffimage_int.cpp index 339c0ade..383c8ee4 100644 --- a/src/tiffimage_int.cpp +++ b/src/tiffimage_int.cpp @@ -251,7 +251,7 @@ namespace Exiv2 { //! Nikon Auto Focus 22 binary array - configuration extern const ArrayCfg nikonAf22Cfg = { nikonAf22Id, // Group for the elements - littleEndian, // Byte order + invalidByteOrder, // Byte order ttUndefined, // Type for array entry notEncrypted, // Not encrypted false, // No size element From 2e14d96bcd55e94e47abdf25a141bfc162331a49 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Fri, 7 Jun 2019 22:11:13 +0100 Subject: [PATCH 4/5] Move test to github (from redmine) --- tests/bugfixes/{redmine => github}/test_issue_646.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/bugfixes/{redmine => github}/test_issue_646.py (100%) diff --git a/tests/bugfixes/redmine/test_issue_646.py b/tests/bugfixes/github/test_issue_646.py similarity index 100% rename from tests/bugfixes/redmine/test_issue_646.py rename to tests/bugfixes/github/test_issue_646.py From db3a260167493baf353b939e23ad86b055751bb2 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 10 Jun 2019 22:43:34 +0100 Subject: [PATCH 5/5] Changes following code review. --- src/nikonmn_int.cpp | 91 ++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index 97d498f1..6554e4f4 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -888,57 +888,56 @@ namespace Exiv2 { { 6, N_("On (105-point)") } }; + // Nikon3 Auto Focus Tag Info + const TagInfo Nikon3MakerNote::tagInfoAf21_[] = { + TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf21Id, makerTags, undefined, 4, printExifVersion), + TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), + TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), + TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf21Id, makerTags, unsignedByte, 7, printValue), + TagInfo( 16, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 18, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 20, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 22, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 24, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 26, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 28, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), + // End of list marker + TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf21Id, makerTags, unsignedByte, 1, printValue) + }; - // Nikon3 Auto Focus Tag Info - const TagInfo Nikon3MakerNote::tagInfoAf21_[] = { - TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf21Id, makerTags, undefined, 4, printExifVersion), - TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), - TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf21Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), - TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf21Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf21Id, makerTags, unsignedByte, 7, printValue), - TagInfo( 16, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 18, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 20, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 22, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 24, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 26, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 28, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf21Id, makerTags, unsignedShort, 1, printValue), - // End of list marker - TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf21Id, makerTags, unsignedByte, 1, printValue) - }; + const TagInfo* Nikon3MakerNote::tagListAf21() + { + return tagInfoAf21_; + } - const TagInfo* Nikon3MakerNote::tagListAf21() - { - return tagInfoAf21_; - } + // Nikon3 Auto Focus Tag Info Version 1.01 https://github.com/Exiv2/exiv2/pull/900 + const TagInfo Nikon3MakerNote::tagInfoAf22_[] = { + TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf22Id, makerTags, undefined, 4, printExifVersion), + TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), + TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), + TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), + TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf22Id, makerTags, unsignedByte, 7, printValue), + TagInfo( 70, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 72, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 74, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 76, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 78, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 80, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + TagInfo( 82, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), + // End of list marker + TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf22Id, makerTags, unsignedByte, 1, printValue) + }; - // Nikon3 Auto Focus Tag Info - const TagInfo Nikon3MakerNote::tagInfoAf22_[] = { - TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonAf22Id, makerTags, undefined, 4, printExifVersion), - TagInfo( 4, "ContrastDetectAF", N_("Contrast Detect AF"), N_("Contrast detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonOffOn)), - TagInfo( 5, "AFAreaMode", N_("AF Area Mode"), N_("AF area mode"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 6, "PhaseDetectAF", N_("Phase Detect AF"), N_("Phase detect AF"), nikonAf22Id, makerTags, unsignedByte, 1, EXV_PRINT_TAG(nikonPhaseDetectAF)), - TagInfo( 7, "PrimaryAFPoint", N_("Primary AF Point"), N_("Primary AF point"), nikonAf22Id, makerTags, unsignedByte, 1, printValue), - TagInfo( 8, "AFPointsUsed", N_("AF Points Used"), N_("AF points used"), nikonAf22Id, makerTags, unsignedByte, 7, printValue), - TagInfo( 70, "AFImageWidth", N_("AF Image Width"), N_("AF image width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 72, "AFImageHeight", N_("AF Image Height"), N_("AF image height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 74, "AFAreaXPosition", N_("AF Area X Position"), N_("AF area x position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 76, "AFAreaYPosition", N_("AF Area Y Position"), N_("AF area y position"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 78, "AFAreaWidth", N_("AF Area Width"), N_("AF area width"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 80, "AFAreaHeight", N_("AF Area Height"), N_("AF area height"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - TagInfo( 82, "ContrastDetectAFInFocus", N_("Contrast Detect AF In Focus"), N_("Contrast detect AF in focus"), nikonAf22Id, makerTags, unsignedShort, 1, printValue), - // End of list marker - TagInfo(0xffff, "(UnknownNikonAf2Tag)", "(UnknownNikonAf2Tag)", N_("Unknown Nikon Auto Focus 2 Tag"), nikonAf22Id, makerTags, unsignedByte, 1, printValue) - }; - - const TagInfo* Nikon3MakerNote::tagListAf22() - { - return tagInfoAf22_; - } + const TagInfo* Nikon3MakerNote::tagListAf22() + { + return tagInfoAf22_; + } - // Nikon3 File Info Tag Info + // Nikon3 File Info Tag Info const TagInfo Nikon3MakerNote::tagInfoFi_[] = { TagInfo( 0, "Version", N_("Version"), N_("Version"), nikonFiId, makerTags, undefined, 4, printExifVersion), TagInfo( 6, "DirectoryNumber", N_("Directory Number"), N_("Directory number"), nikonFiId, makerTags, unsignedShort, 1, printValue),