# -*- coding: utf-8 -*- import system_tests import unittest @unittest.skip("Skipping test using option -pR (only for Debug mode)") class CheckDumpSubFiles(metaclass=system_tests.CaseMeta): url = "http://dev.exiv2.org/issues/1108" filenames = ["$data_path/exiv2-bug1108.exv", "$data_path/imagemagick.png", "$data_path/ReaganLargeTiff.tiff", "$data_path/Reagan.jpg" ] commands = ["$exiv2 -pR " + filenames[0], "$exiv2 -pR " + filenames[1], "$exiv2 -pR " + filenames[2], "$exiv2 -pR " + filenames[3] ] stdout = [ """STRUCTURE OF JPEG FILE: """ + filenames[0] + """ address | marker | length | data 0 | 0xff01 7 | 0xffe1 APP1 | 15296 | Exif..II*...................... STRUCTURE OF TIFF FILE (II): MemIo address | tag | type | count | offset | value 10 | 0x010f Make | ASCII | 18 | 146 | NIKON CORPORATION 22 | 0x0110 Model | ASCII | 12 | 164 | NIKON D5300 34 | 0x0112 Orientation | SHORT | 1 | | 1 46 | 0x011a XResolution | RATIONAL | 1 | 176 | 300/1 58 | 0x011b YResolution | RATIONAL | 1 | 184 | 300/1 70 | 0x0128 ResolutionUnit | SHORT | 1 | | 2 82 | 0x0131 Software | ASCII | 10 | 192 | Ver.1.00 94 | 0x0132 DateTime | ASCII | 20 | 202 | 2015:07:16 20:25:28 106 | 0x0213 YCbCrPositioning | SHORT | 1 | | 1 118 | 0x8769 ExifTag | LONG | 1 | | 222 STRUCTURE OF TIFF FILE (II): MemIo address | tag | type | count | offset | value 224 | 0x829a ExposureTime | RATIONAL | 1 | 732 | 10/4000 236 | 0x829d FNumber | RATIONAL | 1 | 740 | 100/10 248 | 0x8822 ExposureProgram | SHORT | 1 | | 0 260 | 0x8827 ISOSpeedRatings | SHORT | 1 | | 200 272 | 0x8830 SensitivityType | SHORT | 1 | | 2 284 | 0x9000 ExifVersion | UNDEFINED | 4 | | 0230 296 | 0x9003 DateTimeOriginal | ASCII | 20 | 748 | 2015:07:16 15:38:54 308 | 0x9004 DateTimeDigitized | ASCII | 20 | 768 | 2015:07:16 15:38:54 320 | 0x9101 ComponentsConfiguration | UNDEFINED | 4 | | ... 332 | 0x9102 CompressedBitsPerPixel | RATIONAL | 1 | 788 | 2/1 344 | 0x9204 ExposureBiasValue | SRATIONAL | 1 | 796 | 0/6 356 | 0x9205 MaxApertureValue | RATIONAL | 1 | 804 | 43/10 368 | 0x9207 MeteringMode | SHORT | 1 | | 5 380 | 0x9208 LightSource | SHORT | 1 | | 0 392 | 0x9209 Flash | SHORT | 1 | | 16 404 | 0x920a FocalLength | RATIONAL | 1 | 812 | 440/10 416 | 0x927c MakerNote | UNDEFINED | 3152 | 820 | Nikon.....II*.....9.........0211 ... STRUCTURE OF TIFF FILE (II): MemIo address | tag | type | count | offset | value 10 | 0x0001 Version | UNDEFINED | 4 | | 0211 22 | 0x0002 ISOSpeed | SHORT | 2 | | 0 200 34 | 0x0004 Quality | ASCII | 8 | 698 | NORMAL 46 | 0x0005 WhiteBalance | ASCII | 13 | 706 | AUTO 58 | 0x0007 Focus | ASCII | 7 | 720 | AF-A 70 | 0x0008 FlashSetting | ASCII | 13 | 728 | 82 | 0x0009 GPSStatus | ASCII | 20 | 742 | 94 | 0x000b ProcessingSoftware | SSHORT | 2 | | 0 0 106 | 0x000c GPSSpeedRef | RATIONAL | 4 | 762 | 538/256 354/256 256/256 256/256 118 | 0x000d GPSSpeed | UNDEFINED | 4 | | ... 130 | 0x000e GPSTrackRef | UNDEFINED | 4 | | ... 142 | 0x0012 GPSMapDatum | UNDEFINED | 4 | | ... 154 | 0x0013 GPSDestLatitudeRef | SHORT | 2 | | 0 200 166 | 0x0016 GPSDestLongitude | SHORT | 4 | 794 | 0 0 6000 4000 178 | 0x0017 GPSDestBearingRef | UNDEFINED | 4 | | ... 190 | 0x0018 GPSDestBearing | UNDEFINED | 4 | | ... 202 | 0x0019 GPSDestDistanceRef | SRATIONAL | 1 | 802 | 0/6 214 | 0x001b GPSProcessingMethod | SHORT | 7 | 810 | 0 6016 4016 6016 4016 ... 226 | 0x001c GPSAreaInformation | UNDEFINED | 3 | | ... 238 | 0x001d GPSDateStamp | ASCII | 8 | 824 | 2567806 250 | 0x001e GPSDifferential | SHORT | 1 | | 1 262 | 0x001f | UNDEFINED | 8 | 832 | 0100... 274 | 0x0022 | SHORT | 1 | | 65535 286 | 0x0023 | UNDEFINED | 58 | 840 | 0100STANDARD............STANDARD ... 298 | 0x0024 | UNDEFINED | 4 | | ... 310 | 0x0025 | UNDEFINED | 14 | 898 | H.....H...... 322 | 0x002b | UNDEFINED | 16 | 912 | 0100........... 334 | 0x002c | UNDEFINED | 574 | 928 | 0101#.......................... ... 346 | 0x002d | SHORT | 3 | 1502 | 512 0 0 358 | 0x0032 | UNDEFINED | 8 | 1508 | 0100... 370 | 0x0035 | UNDEFINED | 6 | 1516 | 0200. 382 | 0x003b | RATIONAL | 4 | 1522 | 256/256 256/256 256/256 256/256 394 | 0x003c | SHORT | 1 | | 1 406 | 0x0083 | BYTE | 1 | | . 418 | 0x0084 | RATIONAL | 4 | 1554 | 180/10 2500/10 35/10 63/10 430 | 0x0087 | BYTE | 1 | | 442 | 0x0089 | SHORT | 1 | | 0 454 | 0x008a | SHORT | 1 | | 1 466 | 0x008b | UNDEFINED | 4 | | 7.. 478 | 0x0095 | ASCII | 5 | 1586 | OFF 490 | 0x0097 | UNDEFINED | 1188 | 1592 | 0219.dU....W..2......:.......F.# ... 502 | 0x0098 | UNDEFINED | 33 | 2780 | 0204.W....z.o..#[.....!o.x..E... ... 514 | 0x009d | SHORT | 1 | | 0 526 | 0x009e | SHORT | 10 | 2814 | 0 0 0 0 0 ... 538 | 0x00a2 | LONG | 1 | | 6173648 550 | 0x00a3 | BYTE | 1 | | 562 | 0x00a7 | LONG | 1 | | 9608 574 | 0x00a8 | UNDEFINED | 49 | 2834 | 0106........................... ... 586 | 0x00ab | ASCII | 16 | 2884 | AUTO(FLASH OFF) 598 | 0x00b0 | UNDEFINED | 16 | 2900 | 0100........... 610 | 0x00b1 | SHORT | 1 | | 4 622 | 0x00b6 | UNDEFINED | 8 | 2916 | ....... 634 | 0x00b7 | UNDEFINED | 30 | 2924 | 0100....i.................... 646 | 0x00b8 | UNDEFINED | 172 | 2954 | 0100..e........................ ... 658 | 0x00bb | UNDEFINED | 8 | 3126 | 0200... 670 | 0x00bf | SHORT | 1 | | 0 682 | 0x00c0 | UNDEFINED | 8 | 3134 | <...... END MemIo 428 | 0x9286 UserComment | UNDEFINED | 44 | 3972 | ASCII... ... 440 | 0x9290 SubSecTime | ASCII | 3 | | 00 452 | 0x9291 SubSecTimeOriginal | ASCII | 3 | | 00 464 | 0x9292 SubSecTimeDigitized | ASCII | 3 | | 00 476 | 0xa000 FlashpixVersion | UNDEFINED | 4 | | 0100 488 | 0xa001 ColorSpace | SHORT | 1 | | 1 500 | 0xa002 PixelXDimension | SHORT | 1 | | 6000 512 | 0xa003 PixelYDimension | SHORT | 1 | | 4000 524 | 0xa005 InteroperabilityTag | LONG | 1 | | 4066 536 | 0xa217 SensingMethod | SHORT | 1 | | 2 548 | 0xa300 FileSource | UNDEFINED | 1 | | . 560 | 0xa301 SceneType | UNDEFINED | 1 | | . 572 | 0xa302 CFAPattern | UNDEFINED | 8 | 4016 | ........ 584 | 0xa401 CustomRendered | SHORT | 1 | | 0 596 | 0xa402 ExposureMode | SHORT | 1 | | 0 608 | 0xa403 WhiteBalance | SHORT | 1 | | 0 620 | 0xa404 DigitalZoomRatio | RATIONAL | 1 | 4024 | 1/1 632 | 0xa405 FocalLengthIn35mmFilm | SHORT | 1 | | 66 644 | 0xa406 SceneCaptureType | SHORT | 1 | | 0 656 | 0xa407 GainControl | SHORT | 1 | | 0 668 | 0xa408 Contrast | SHORT | 1 | | 0 680 | 0xa409 Saturation | SHORT | 1 | | 0 692 | 0xa40a Sharpness | SHORT | 1 | | 0 704 | 0xa40c SubjectDistanceRange | SHORT | 1 | | 0 716 | 0xa420 ImageUniqueID | ASCII | 33 | 4032 | 090caaf2c085f3e102513b24750041aa ... END MemIo 130 | 0x8825 GPSTag | LONG | 1 | | 4096 4346 | 0x0103 Compression | SHORT | 1 | | 6 4358 | 0x011a XResolution | RATIONAL | 1 | 4434 | 300/1 4370 | 0x011b YResolution | RATIONAL | 1 | 4442 | 300/1 4382 | 0x0128 ResolutionUnit | SHORT | 1 | | 2 4394 | 0x0201 JPEGInterchangeFormat | LONG | 1 | | 4450 4406 | 0x0202 JPEGInterchangeFormatLength | LONG | 1 | | 10837 4418 | 0x0213 YCbCrPositioning | SHORT | 1 | | 1 END MemIo 15305 | 0xffe1 APP1 | 2610 | http://ns.adobe.com/xap/1.0/...]....UKqD2s.(.q....=x.l.\ | 0xc177fe83 67560 | IDAT | 8192 | .i.{!!B0...C!4.p..`D g`....... | 0x0e276268 75764 | IDAT | 8192 | .*.].4..Q..}(9...S0&.......T.9 | 0x297bb2db 83968 | IDAT | 8192 | ..k...6....g.1..}.].&.H....... | 0x05f6f4ef 92172 | IDAT | 8192 | .j..S.........z..!U.G0*.m%..09 | 0xe0946eb5 100376 | IDAT | 8192 | .....t.>!.....6^.<..;..?.$I..M | 0x843ecce0 108580 | IDAT | 8192 | W.&5.5J........FW`....3.N.9Pk; | 0x3a3dfeee 116784 | IDAT | 8192 | .....d.z".`...v=g-..-.c8...Z.5 | 0x65d6df49 124988 | IDAT | 8192 | .."...o<&."....1M....1&. ..5.. | 0x700b8cde 133192 | IDAT | 8192 | k........!..B*.....\*.(!..0.s. | 0x9b33b5b7 141396 | IDAT | 3346 | .Y.L@I$M.Z[.0A ...K#.t.0+.G(.j | 0x18044b20 144754 | IEND | 0 | | 0xae426082 """, """STRUCTURE OF TIFF FILE (II): """ + filenames[2] + """ address | tag | type | count | offset | value 10 | 0x00fe NewSubfileType | LONG | 1 | | 0 22 | 0x0100 ImageWidth | SHORT | 1 | | 200 34 | 0x0101 ImageLength | SHORT | 1 | | 130 46 | 0x0102 BitsPerSample | SHORT | 3 | 374 | 8 8 8 58 | 0x0103 Compression | SHORT | 1 | | 5 70 | 0x0106 PhotometricInterpretation | SHORT | 1 | | 2 82 | 0x010d DocumentName | ASCII | 59 | 380 | /media/trekstor/exiv2/exiv2-svn/ ... 94 | 0x010e ImageDescription | ASCII | 403 | 440 | 040621-N-6536T-062.USS Ronald Re ... 106 | 0x010f Make | ASCII | 18 | 844 | NIKON CORPORATION 118 | 0x0110 Model | ASCII | 10 | 862 | NIKON D1X 130 | 0x0111 StripOffsets | LONG | 2 | 872 | 1623650 1667534 142 | 0x0112 Orientation | SHORT | 1 | | 1 154 | 0x0115 SamplesPerPixel | SHORT | 1 | | 3 166 | 0x0116 RowsPerStrip | SHORT | 1 | | 128 178 | 0x0117 StripByteCounts | LONG | 2 | 880 | 43883 931 190 | 0x011a XResolution | RATIONAL | 1 | 888 | 300/1 202 | 0x011b YResolution | RATIONAL | 1 | 896 | 300/1 214 | 0x011c PlanarConfiguration | SHORT | 1 | | 1 226 | 0x0128 ResolutionUnit | SHORT | 1 | | 2 238 | 0x0131 Software | ASCII | 11 | 904 | GIMP 2.9.5 250 | 0x0132 DateTime | ASCII | 20 | 916 | 2016:09:13 12:23:27 262 | 0x013b Artist | ASCII | 34 | 936 | Photographer..s Mate 3rd Class ( ... 274 | 0x013d Predictor | SHORT | 1 | | 2 286 | 0x014a SubIFDs | LONG | 1 | | 1622480 STRUCTURE OF TIFF FILE (II): """ + filenames[2] + """ address | tag | type | count | offset | value 1622482 | 0x00fe NewSubfileType | LONG | 1 | | 1 1622494 | 0x0100 ImageWidth | SHORT | 1 | | 256 1622506 | 0x0101 ImageLength | SHORT | 1 | | 166 1622518 | 0x0102 BitsPerSample | SHORT | 3 | 1622630 | 8 8 8 1622530 | 0x0103 Compression | SHORT | 1 | | 1 1622542 | 0x0106 PhotometricInterpretation | SHORT | 1 | | 2 1622554 | 0x0111 StripOffsets | LONG | 1 | | 1668466 1622566 | 0x0115 SamplesPerPixel | SHORT | 1 | | 3 1622578 | 0x0116 RowsPerStrip | SHORT | 1 | | 166 1622590 | 0x0117 StripByteCounts | LONG | 1 | | 127488 1622602 | 0x011c PlanarConfiguration | SHORT | 1 | | 1 1622614 | 0x0153 SampleFormat | SHORT | 3 | 1622636 | 1 1 1 END """ + filenames[2] + """ 298 | 0x0153 SampleFormat | SHORT | 3 | 970 | 1 1 1 310 | 0x02bc XMLPacket | BYTE | 7135 | 976 |