From 5e7a56340759d3b7f7b66ffc1a4bbbd4b96a667c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Komar=C4=8Devi=C4=87?= Date: Wed, 9 Dec 2020 09:28:49 +0100 Subject: [PATCH] Pretty print PlanarConfig --- src/tags_int.cpp | 8 +++++++- test/data/tiff-test.out | 4 ++-- tests/bugfixes/redmine/test_issue_831.py | 2 +- tests/tiff_test/test_tag_compare.py | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tags_int.cpp b/src/tags_int.cpp index e9b95a39..5133ddc3 100644 --- a/src/tags_int.cpp +++ b/src/tags_int.cpp @@ -190,6 +190,12 @@ namespace Exiv2 { { 8, N_("left, bottom") } // To silence compiler warning }; + //! PlanarConfiguration, tag 0x011c + extern const TagDetails exifPlanarConfiguration[] = { + { 1, N_("Chunky") }, + { 2, N_("Planar") } + }; + //! Predictor, tag 0x013d extern const TagDetails exifPredictor[] = { { 1, N_("No prediction scheme used") }, @@ -585,7 +591,7 @@ namespace Exiv2 { "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."), - ifd0Id, imgStruct, unsignedShort, 1, printValue), + ifd0Id, imgStruct, unsignedShort, 1, EXV_PRINT_TAG(exifPlanarConfiguration)), TagInfo(0x0122, "GrayResponseUnit", N_("Gray Response Unit"), N_("The precision of the information contained in the GrayResponseCurve."), ifd0Id, imgStruct, unsignedShort, 1, printValue), // TIFF tag diff --git a/test/data/tiff-test.out b/test/data/tiff-test.out index a59f8f39..01ac5b46 100644 --- a/test/data/tiff-test.out +++ b/test/data/tiff-test.out @@ -14,7 +14,7 @@ RowsPerStrip Short 1 "64" StripByteCounts Long 1 "243" XResolution Rational 1 "72" YResolution Rational 1 "72" -PlanarConfiguration Short 1 "1" +PlanarConfiguration Short 1 "Chunky" ResolutionUnit Short 1 "inch" exiv2 -pS output @@ -99,7 +99,7 @@ RowsPerStrip Short 1 "64" StripByteCounts Long 1 "243" XResolution Rational 1 "72" YResolution Rational 1 "72" -PlanarConfiguration Short 1 "1" +PlanarConfiguration Short 1 "Chunky" ResolutionUnit Short 1 "inch" ExifTag Long 1 "294" DateTimeOriginal Ascii 18 "Yesterday at noon" diff --git a/tests/bugfixes/redmine/test_issue_831.py b/tests/bugfixes/redmine/test_issue_831.py index 3369869b..7f044150 100644 --- a/tests/bugfixes/redmine/test_issue_831.py +++ b/tests/bugfixes/redmine/test_issue_831.py @@ -35,7 +35,7 @@ Exif.Image.RowsPerStrip Short 1 64 Exif.Image.StripByteCounts Long 1 243 Exif.Image.XResolution Rational 1 72 Exif.Image.YResolution Rational 1 72 -Exif.Image.PlanarConfiguration Short 1 1 +Exif.Image.PlanarConfiguration Short 1 Chunky Exif.Image.ResolutionUnit Short 1 inch """ ] diff --git a/tests/tiff_test/test_tag_compare.py b/tests/tiff_test/test_tag_compare.py index b50dd196..a8538bd2 100644 --- a/tests/tiff_test/test_tag_compare.py +++ b/tests/tiff_test/test_tag_compare.py @@ -92,7 +92,7 @@ class OutputTagExtract(metaclass=system_tests.CaseMeta): if pa_elem["tag"] in [ "ImageWidth", "ImageLength", "BitsPerSample", "DocumentName", "ImageDescription", "StripOffsets", - "SamplesPerPixel", "StripByteCounts", "PlanarConfiguration"]: + "SamplesPerPixel", "StripByteCounts"]: self.assertEquals(pa_elem["val"], pS_elem["val"]) def compare_stdout(self, i, command, got_stdout, expected_stdout): @@ -128,7 +128,7 @@ Exif.Image.RowsPerStrip Short 1 64 Exif.Image.StripByteCounts Long 1 243 Exif.Image.XResolution Rational 1 72 Exif.Image.YResolution Rational 1 72 -Exif.Image.PlanarConfiguration Short 1 1 +Exif.Image.PlanarConfiguration Short 1 Chunky Exif.Image.ResolutionUnit Short 1 inch """, """STRUCTURE OF TIFF FILE (II): $data_path/mini9.tif