From 05538ebea210745e441a89c2ca20029ec427dd19 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 29 Sep 2019 18:32:40 +0100 Subject: [PATCH] fix1001_rename_AFPrimaryPoint --- src/canonmn_int.cpp | 2 +- src/exif.cpp | 2 +- src/tiffvisitor_int.cpp | 2 +- tests/bugfixes/github/test_issue_981.py | 15 ++++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/canonmn_int.cpp b/src/canonmn_int.cpp index 8b9e67ba..33f6a0f2 100644 --- a/src/canonmn_int.cpp +++ b/src/canonmn_int.cpp @@ -473,7 +473,7 @@ namespace Exiv2 { TagInfo(0x260b, "AFYPositions", N_("AF Y Positions"), N_("AF Y Positions"), canonId, makerTags, signedShort, -1, printValue), TagInfo(0x260c, "AFPointsInFocus", N_("AF Points in Focus"), N_("AF Points in Focus"), canonId, makerTags, signedShort, -1,printBitmask), TagInfo(0x260d, "AFPointsSelected", N_("AF Points Selected"), N_("AF Points Selected"), canonId, makerTags, signedShort, -1, printBitmask), - TagInfo(0x260e, "AFPrimaryPoint", N_("AF Primary Point"), N_("AF Primary Point"), canonId, makerTags, signedShort, -1, printBitmask), + TagInfo(0x260e, "AFPointsUnusable", N_("AF Points Unusable"), N_("AF Points Unusable"), canonId, makerTags, signedShort, -1, printBitmask), TagInfo(0x4001, "ColorData", N_("Color Data"), N_("Color data"), canonId, makerTags, unsignedShort, -1, printValue), // End of list marker TagInfo(0xffff, "(UnknownCanonMakerNoteTag)", "(UnknownCanonMakerNoteTag)", N_("Unknown CanonMakerNote tag"), canonId, makerTags, asciiString, -1, printValue) diff --git a/src/exif.cpp b/src/exif.cpp index b1622abe..85c015ef 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -676,7 +676,7 @@ namespace Exiv2 { "Exif.Canon.AFYPositions", "Exif.Canon.AFPointsInFocus", "Exif.Canon.AFPointsSelected", - "Exif.Canon.AFPrimaryPoint", + "Exif.Canon.AFPointsUnusable", }; for (unsigned int i = 0; i < EXV_COUNTOF(filteredIfd0Tags); ++i) { ExifData::iterator pos = ed.findKey(ExifKey(filteredIfd0Tags[i])); diff --git a/src/tiffvisitor_int.cpp b/src/tiffvisitor_int.cpp index 930a75dd..066e4fc5 100644 --- a/src/tiffvisitor_int.cpp +++ b/src/tiffvisitor_int.cpp @@ -509,7 +509,7 @@ namespace Exiv2 { { 0x260b , nPoints , true }, // AFYPositions { 0x260c , nMasks , false }, // AFPointsInFocus { 0x260d , nMasks , false }, // AFPointsSelected - { 0x260e , nMasks , false }, // AFPrimaryPoint + { 0x260e , nMasks , false }, // AFPointsUnusable { 0xffff , 0 , true } // end marker }; // check we have enough data! diff --git a/tests/bugfixes/github/test_issue_981.py b/tests/bugfixes/github/test_issue_981.py index 8ca937de..2b06960e 100644 --- a/tests/bugfixes/github/test_issue_981.py +++ b/tests/bugfixes/github/test_issue_981.py @@ -7,14 +7,13 @@ class CanonAfInfoTest(metaclass=CaseMeta): filenameA = path("$data_path/test_issue_981a.exv") filenameB = path("$data_path/test_issue_981b.exv") filenameC = path("$data_path/test_issue_981c.exv") - filenameC = path("$data_path/test_issue_981c.exv") filenameD = path("$data_path/test_issue_981d.exv") commands = ["$exiv2 -pa --grep Canon.AF $filenameA", "$exiv2 -pa --grep Canon.AF $filenameB", "$exiv2 -pv --grep Points $filenameC", "$exiv2 -pt --grep Points $filenameC", - "$exiv2 -pv --grep Primary $filenameD", - "$exiv2 -pt --grep Primary $filenameD", + "$exiv2 -pv --grep Unusable $filenameD", + "$exiv2 -pt --grep Unusable $filenameD", ] stdout = ["""Exif.Canon.AFInfo Short 48 96 2 9 9 4752 3168 4272 2848 115 115 115 162 200 162 115 115 115 153 153 153 105 199 105 153 153 153 64409 64862 64862 0 0 0 674 674 1127 0 321 65215 603 0 64933 321 65215 0 16 256 0 65535 @@ -32,7 +31,7 @@ Exif.Canon.AFXPositions SShort 9 -1127 -674 -674 0 0 Exif.Canon.AFYPositions SShort 9 0 321 -321 603 0 -603 321 -321 0 Exif.Canon.AFPointsInFocus Short 1 4 Exif.Canon.AFPointsSelected Short 1 8 -Exif.Canon.AFPrimaryPoint Short 1 (none) +Exif.Canon.AFPointsUnusable Short 1 (none) """ , """Exif.Canon.AFInfo Short 273 546 2 63 61 6720 4480 6720 4480 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 0 0 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 218 0 0 65200 64790 64435 64099 63764 336 0 65200 64099 63764 1772 1437 1101 746 336 0 1437 1101 746 336 0 65200 64790 64435 336 0 65200 64790 64435 64099 63764 1772 64790 64435 64099 63764 1772 1437 1101 746 63764 1772 1437 1101 746 336 0 65200 1101 746 336 0 65200 64790 64435 64099 336 0 65200 1772 1437 0 0 547 625 625 625 625 821 821 821 308 308 625 625 625 625 547 547 308 308 308 274 274 274 308 308 0 0 0 0 0 0 0 308 65228 65228 65228 65228 0 0 0 0 64911 65228 65228 65228 65228 65262 65262 65262 64911 64911 64989 64989 64989 64911 64911 64911 64715 64715 64715 64911 64911 0 0 0 512 0 0 0 512 0 0 0 0 0 0 65535 Exif.Canon.AFInfoSize SShort 1 546 Exif.Canon.AFAreaMode SShort 1 Single-point AF @@ -48,17 +47,19 @@ Exif.Canon.AFXPositions SShort 63 -336 -746 -1101 -143 Exif.Canon.AFYPositions SShort 63 547 625 625 625 625 821 821 821 308 308 625 625 625 625 547 547 308 308 308 274 274 274 308 308 0 0 0 0 0 0 0 308 -308 -308 -308 -308 0 0 0 0 -625 -308 -308 -308 -308 -274 -274 -274 -625 -625 -547 -547 -547 -625 -625 -625 -821 -821 -821 -625 -625 0 0 Exif.Canon.AFPointsInFocus Short 4 25 Exif.Canon.AFPointsSelected Short 4 25 -Exif.Canon.AFPrimaryPoint Short 4 (none) +Exif.Canon.AFPointsUnusable Short 4 (none) ""","""0x2602 Canon AFNumPoints SShort 1 63 0x2603 Canon AFValidPoints SShort 1 61 0x260c Canon AFPointsInFocus Short 4 0 560 57344 0 0x260d Canon AFPointsSelected Short 4 0 1848 57344 0 +0x260e Canon AFPointsUnusable Short 4 0 0 0 0 ""","""Exif.Canon.AFNumPoints SShort 1 63 Exif.Canon.AFValidPoints SShort 1 61 Exif.Canon.AFPointsInFocus Short 4 20,21,25,45,46,47 Exif.Canon.AFPointsSelected Short 4 19,20,21,24,25,26,45,46,47 -""","""0x260e Canon AFPrimaryPoint Short 4 3608 49152 792 6272 -""","""Exif.Canon.AFPrimaryPoint Short 4 3,4,9,10,11,30,31,35,36,40,41,55,59,60 +Exif.Canon.AFPointsUnusable Short 4 (none) +""","""0x260e Canon AFPointsUnusable Short 4 3608 49152 792 6272 +""","""Exif.Canon.AFPointsUnusable Short 4 3,4,9,10,11,30,31,35,36,40,41,55,59,60 """ ] stderr = [""]*len(commands)