Skip to content

Commit 01a146e

Browse files
authored
Merge pull request #1427 from Exiv2/prettyprint_planarconfig
Pretty print PlanarConfig
2 parents aa07607 + 5e7a563 commit 01a146e

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/tags_int.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ namespace Exiv2 {
190190
{ 8, N_("left, bottom") } // To silence compiler warning
191191
};
192192

193+
//! PlanarConfiguration, tag 0x011c
194+
extern const TagDetails exifPlanarConfiguration[] = {
195+
{ 1, N_("Chunky") },
196+
{ 2, N_("Planar") }
197+
};
198+
193199
//! Predictor, tag 0x013d
194200
extern const TagDetails exifPredictor[] = {
195201
{ 1, N_("No prediction scheme used") },
@@ -585,7 +591,7 @@ namespace Exiv2 {
585591
"or planar format. In JPEG compressed files a JPEG marker "
586592
"is used instead of this tag. If this field does not exist, "
587593
"the TIFF default of 1 (chunky) is assumed."),
588-
ifd0Id, imgStruct, unsignedShort, 1, printValue),
594+
ifd0Id, imgStruct, unsignedShort, 1, EXV_PRINT_TAG(exifPlanarConfiguration)),
589595
TagInfo(0x0122, "GrayResponseUnit", N_("Gray Response Unit"),
590596
N_("The precision of the information contained in the GrayResponseCurve."),
591597
ifd0Id, imgStruct, unsignedShort, 1, printValue), // TIFF tag

test/data/tiff-test.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RowsPerStrip Short 1 "64"
1414
StripByteCounts Long 1 "243"
1515
XResolution Rational 1 "72"
1616
YResolution Rational 1 "72"
17-
PlanarConfiguration Short 1 "1"
17+
PlanarConfiguration Short 1 "Chunky"
1818
ResolutionUnit Short 1 "inch"
1919

2020
exiv2 -pS output
@@ -99,7 +99,7 @@ RowsPerStrip Short 1 "64"
9999
StripByteCounts Long 1 "243"
100100
XResolution Rational 1 "72"
101101
YResolution Rational 1 "72"
102-
PlanarConfiguration Short 1 "1"
102+
PlanarConfiguration Short 1 "Chunky"
103103
ResolutionUnit Short 1 "inch"
104104
ExifTag Long 1 "294"
105105
DateTimeOriginal Ascii 18 "Yesterday at noon"

tests/bugfixes/redmine/test_issue_831.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class UseNonIntrusiveWriting(metaclass=CaseMeta):
3535
Exif.Image.StripByteCounts Long 1 243
3636
Exif.Image.XResolution Rational 1 72
3737
Exif.Image.YResolution Rational 1 72
38-
Exif.Image.PlanarConfiguration Short 1 1
38+
Exif.Image.PlanarConfiguration Short 1 Chunky
3939
Exif.Image.ResolutionUnit Short 1 inch
4040
"""
4141
]

tests/tiff_test/test_tag_compare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def compare_pS_pa(self):
9292
if pa_elem["tag"] in [
9393
"ImageWidth", "ImageLength", "BitsPerSample",
9494
"DocumentName", "ImageDescription", "StripOffsets",
95-
"SamplesPerPixel", "StripByteCounts", "PlanarConfiguration"]:
95+
"SamplesPerPixel", "StripByteCounts"]:
9696
self.assertEquals(pa_elem["val"], pS_elem["val"])
9797

9898
def compare_stdout(self, i, command, got_stdout, expected_stdout):
@@ -128,7 +128,7 @@ def compare_stdout(self, i, command, got_stdout, expected_stdout):
128128
Exif.Image.StripByteCounts Long 1 243
129129
Exif.Image.XResolution Rational 1 72
130130
Exif.Image.YResolution Rational 1 72
131-
Exif.Image.PlanarConfiguration Short 1 1
131+
Exif.Image.PlanarConfiguration Short 1 Chunky
132132
Exif.Image.ResolutionUnit Short 1 inch
133133
""",
134134
"""STRUCTURE OF TIFF FILE (II): $data_path/mini9.tif

0 commit comments

Comments
 (0)