Merge pull request #2440 from Exiv2/png_exif

Prefer writing PNG eXIf chunk
This commit is contained in:
Miloš Komarčević 2022-12-27 15:18:18 +01:00 committed by GitHub
commit 0f65c857a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 147 additions and 138 deletions

View File

@ -321,14 +321,12 @@ std::string PngChunk::makeMetadataChunk(const std::string& metadata, MetadataId
switch (type) { switch (type) {
case mdComment: case mdComment:
return makeUtf8TxtChunk("Description", metadata, true); return makeUtf8TxtChunk("Description", metadata, true);
case mdExif:
rawProfile = writeRawProfile(metadata, "exif");
return makeAsciiTxtChunk("Raw profile type exif", rawProfile, true);
case mdIptc: case mdIptc:
rawProfile = writeRawProfile(metadata, "iptc"); rawProfile = writeRawProfile(metadata, "iptc");
return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true); return makeAsciiTxtChunk("Raw profile type iptc", rawProfile, true);
case mdXmp: case mdXmp:
return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false); return makeUtf8TxtChunk("XML:com.adobe.xmp", metadata, false);
case mdExif:
case mdIccProfile: case mdIccProfile:
case mdNone: case mdNone:
return {}; return {};

View File

@ -39,6 +39,7 @@ constexpr unsigned char pngBlank[] = {
}; };
const auto nullComp = reinterpret_cast<const Exiv2::byte*>("\0\0"); const auto nullComp = reinterpret_cast<const Exiv2::byte*>("\0\0");
const auto typeExif = reinterpret_cast<const Exiv2::byte*>("eXIf");
const auto typeICCP = reinterpret_cast<const Exiv2::byte*>("iCCP"); const auto typeICCP = reinterpret_cast<const Exiv2::byte*>("iCCP");
inline bool compare(std::string_view str, const Exiv2::DataBuf& buf) { inline bool compare(std::string_view str, const Exiv2::DataBuf& buf) {
const auto minlen = std::min(str.size(), buf.size()); const auto minlen = std::min(str.size(), buf.size());
@ -306,7 +307,7 @@ void PngImage::printStructure(std::ostream& out, PrintStructureOption option, si
bGood = (3 <= dataOffset) && (start < dataOffset - 3); // good if not a nul chunk bGood = (3 <= dataOffset) && (start < dataOffset - 3); // good if not a nul chunk
} }
if (eXIf) { if (eXIf) {
bGood = true; // eXIf requires no pre-processing) bGood = true; // eXIf requires no pre-processing
} }
// format is content dependent // format is content dependent
@ -548,8 +549,7 @@ void PngImage::doWriteMetadata(BasicIo& outIo) {
} }
if (!strcmp(szChunk, "eXIf") || !strcmp(szChunk, "iCCP")) { if (!strcmp(szChunk, "eXIf") || !strcmp(szChunk, "iCCP")) {
// do nothing (strip): Exif metadata is written following IHDR // do nothing (strip): Exif metadata is written following IHDR
// as zTXt chunk with signature "Raw profile type exif", // together with the ICC profile as fresh eXIf and iCCP chunks
// together with the ICC profile as a fresh iCCP chunk
#ifdef EXIV2_DEBUG_MESSAGES #ifdef EXIV2_DEBUG_MESSAGES
std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")" std::cout << "Exiv2::PngImage::doWriteMetadata: strip " << szChunk << " chunk (length: " << dataOffset << ")"
<< std::endl; << std::endl;
@ -575,13 +575,24 @@ void PngImage::doWriteMetadata(BasicIo& outIo) {
Blob blob; Blob blob;
ExifParser::encode(blob, littleEndian, exifData_); ExifParser::encode(blob, littleEndian, exifData_);
if (!blob.empty()) { if (!blob.empty()) {
static const char exifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; byte length[4];
std::string rawExif = ul2Data(length, static_cast<uint32_t>(blob.size()), bigEndian);
std::string(exifHeader, 6) + std::string(reinterpret_cast<const char*>(blob.data()), blob.size());
std::string chunk = PngChunk::makeMetadataChunk(rawExif, mdExif); // calculate CRC
if (outIo.write(reinterpret_cast<const byte*>(chunk.data()), chunk.size()) != chunk.size()) { uLong tmp = crc32(0L, Z_NULL, 0);
tmp = crc32(tmp, typeExif, 4);
tmp = crc32(tmp, blob.data(), static_cast<uint32_t>(blob.size()));
byte crc[4];
ul2Data(crc, tmp, bigEndian);
if (outIo.write(length, 4) != 4 || outIo.write(typeExif, 4) != 4 ||
outIo.write(blob.data(), blob.size()) != blob.size() || outIo.write(crc, 4) != 4) {
throw Error(ErrorCode::kerImageWriteFailed); throw Error(ErrorCode::kerImageWriteFailed);
} }
#ifdef EXIV2_DEBUG_MESSAGES
std::cout << "Exiv2::PngImage::doWriteMetadata: build eXIf"
<< " chunk (length: " << blob.size() << ")" << std::endl;
#endif
} }
} }
@ -623,7 +634,7 @@ void PngImage::doWriteMetadata(BasicIo& outIo) {
} }
#ifdef EXIV2_DEBUG_MESSAGES #ifdef EXIV2_DEBUG_MESSAGES
std::cout << "Exiv2::PngImage::doWriteMetadata: build iCCP" std::cout << "Exiv2::PngImage::doWriteMetadata: build iCCP"
<< " chunk (length: " << compressed.size() + chunkLength << ")" << std::endl; << " chunk (length: " << chunkLength << ")" << std::endl;
#endif #endif
} }
} }

View File

@ -308,152 +308,152 @@ STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8 33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8
76 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 76 | eXIf | 8408 | II*.......................... | 0x81634e71
8549 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8496 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9197 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519 9144 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519
1168394 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 1168341 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
1175562 | gAMA | 4 | .... | 0x0bfc6105 1175509 | gAMA | 4 | .... | 0x0bfc6105
1175578 | bKGD | 6 | ...... | 0xa0bda793 1175525 | bKGD | 6 | ...... | 0xa0bda793
1175596 | pHYs | 9 | ...#...#. | 0x78a53f76 1175543 | pHYs | 9 | ...#...#. | 0x78a53f76
1175617 | tIME | 7 | ......2 | 0x582d32e4 1175564 | tIME | 7 | ......2 | 0x582d32e4
1175636 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 1175583 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
1175926 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 1175873 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
1184130 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 1184077 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
1192334 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 1192281 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
1200538 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 1200485 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
1208742 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 1208689 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
1215927 | IEND | 0 | | 0xae426082 1215874 | IEND | 0 | | 0xae426082
abcdefg abcdefg
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 33 | eXIf | 8408 | II*.......................... | 0x81634e71
8506 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8453 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9154 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519 9101 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519
1168351 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 1168298 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
1175519 | gAMA | 4 | .... | 0x0bfc6105 1175466 | gAMA | 4 | .... | 0x0bfc6105
1175535 | bKGD | 6 | ...... | 0xa0bda793 1175482 | bKGD | 6 | ...... | 0xa0bda793
1175553 | pHYs | 9 | ...#...#. | 0x78a53f76 1175500 | pHYs | 9 | ...#...#. | 0x78a53f76
1175574 | tIME | 7 | ......2 | 0x582d32e4 1175521 | tIME | 7 | ......2 | 0x582d32e4
1175593 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 1175540 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
1175883 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 1175830 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
1184087 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 1184034 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
1192291 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 1192238 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
1200495 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 1200442 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
1208699 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 1208646 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
1215884 | IEND | 0 | | 0xae426082 1215831 | IEND | 0 | | 0xae426082
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 33 | eXIf | 8408 | II*.......................... | 0x81634e71
8506 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8453 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9154 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519 9101 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519
1168351 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 1168298 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
1175519 | gAMA | 4 | .... | 0x0bfc6105 1175466 | gAMA | 4 | .... | 0x0bfc6105
1175535 | bKGD | 6 | ...... | 0xa0bda793 1175482 | bKGD | 6 | ...... | 0xa0bda793
1175553 | pHYs | 9 | ...#...#. | 0x78a53f76 1175500 | pHYs | 9 | ...#...#. | 0x78a53f76
1175574 | tIME | 7 | ......2 | 0x582d32e4 1175521 | tIME | 7 | ......2 | 0x582d32e4
1175593 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 1175540 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
1175883 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 1175830 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
1184087 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 1184034 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
1192291 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 1192238 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
1200495 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 1200442 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
1208699 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 1208646 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
1215884 | IEND | 0 | | 0xae426082 1215831 | IEND | 0 | | 0xae426082
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8 33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8
76 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 76 | eXIf | 8408 | II*.......................... | 0x81634e71
8549 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8496 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9197 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519 9144 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519
1168394 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 1168341 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
1175562 | gAMA | 4 | .... | 0x0bfc6105 1175509 | gAMA | 4 | .... | 0x0bfc6105
1175578 | bKGD | 6 | ...... | 0xa0bda793 1175525 | bKGD | 6 | ...... | 0xa0bda793
1175596 | pHYs | 9 | ...#...#. | 0x78a53f76 1175543 | pHYs | 9 | ...#...#. | 0x78a53f76
1175617 | tIME | 7 | ......2 | 0x582d32e4 1175564 | tIME | 7 | ......2 | 0x582d32e4
1175636 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 1175583 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
1175926 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 1175873 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
1184130 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 1184077 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
1192334 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 1192281 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
1200538 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 1200485 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
1208742 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 1208689 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
1215927 | IEND | 0 | | 0xae426082 1215874 | IEND | 0 | | 0xae426082
abcdefg abcdefg
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 33 | eXIf | 8408 | II*.......................... | 0x81634e71
8506 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8453 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9154 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519 9101 | iCCP | 1159185 | ICC profile..x...uP.[..9@.HB.D | 0xd3dbe519
1168351 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 1168298 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
1175519 | gAMA | 4 | .... | 0x0bfc6105 1175466 | gAMA | 4 | .... | 0x0bfc6105
1175535 | bKGD | 6 | ...... | 0xa0bda793 1175482 | bKGD | 6 | ...... | 0xa0bda793
1175553 | pHYs | 9 | ...#...#. | 0x78a53f76 1175500 | pHYs | 9 | ...#...#. | 0x78a53f76
1175574 | tIME | 7 | ......2 | 0x582d32e4 1175521 | tIME | 7 | ......2 | 0x582d32e4
1175593 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 1175540 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
1175883 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 1175830 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
1184087 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 1184034 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
1192291 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 1192238 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
1200495 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 1200442 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
1208699 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 1208646 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
1215884 | IEND | 0 | | 0xae426082 1215831 | IEND | 0 | | 0xae426082
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 33 | eXIf | 8408 | II*.......................... | 0x81634e71
8506 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8453 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9154 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b 9101 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b
9459 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 9406 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
16627 | gAMA | 4 | .... | 0x0bfc6105 16574 | gAMA | 4 | .... | 0x0bfc6105
16643 | bKGD | 6 | ...... | 0xa0bda793 16590 | bKGD | 6 | ...... | 0xa0bda793
16661 | pHYs | 9 | ...#...#. | 0x78a53f76 16608 | pHYs | 9 | ...#...#. | 0x78a53f76
16682 | tIME | 7 | ......2 | 0x582d32e4 16629 | tIME | 7 | ......2 | 0x582d32e4
16701 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 16648 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
16991 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 16938 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
25195 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 25142 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
33399 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 33346 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
41603 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 41550 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
49807 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 49754 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
56992 | IEND | 0 | | 0xae426082 56939 | IEND | 0 | | 0xae426082
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8 33 | iTXt | 31 | Description.....x.KLJNIMK..... | 0xc1fefec8
76 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 76 | eXIf | 8408 | II*.......................... | 0x81634e71
8549 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8496 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9197 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b 9144 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b
9502 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 9449 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
16670 | gAMA | 4 | .... | 0x0bfc6105 16617 | gAMA | 4 | .... | 0x0bfc6105
16686 | bKGD | 6 | ...... | 0xa0bda793 16633 | bKGD | 6 | ...... | 0xa0bda793
16704 | pHYs | 9 | ...#...#. | 0x78a53f76 16651 | pHYs | 9 | ...#...#. | 0x78a53f76
16725 | tIME | 7 | ......2 | 0x582d32e4 16672 | tIME | 7 | ......2 | 0x582d32e4
16744 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 16691 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
17034 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 16981 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
25238 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 25185 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
33442 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 33389 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
41646 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 41593 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
49850 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 49797 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
57035 | IEND | 0 | | 0xae426082 56982 | IEND | 0 | | 0xae426082
abcdefg abcdefg
STRUCTURE OF PNG FILE: ReaganLargePng.png STRUCTURE OF PNG FILE: ReaganLargePng.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | ............ | 0x8cf910c3 8 | IHDR | 13 | ............ | 0x8cf910c3
33 | zTXt | 8461 | Raw profile type exif..x...iv. | 0x91fbf6a0 33 | eXIf | 8408 | II*.......................... | 0x81634e71
8506 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3 8453 | zTXt | 636 | Raw profile type iptc..x..TKn. | 0x4e5178d3
9154 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b 9101 | iCCP | 293 | ICC profile..x.c``2ptqre.``..+ | 0x7d41600b
9459 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba 9406 | iTXt | 7156 | XML:com.adobe.xmp.....<?xpacke | 0x8d6d70ba
16627 | gAMA | 4 | .... | 0x0bfc6105 16574 | gAMA | 4 | .... | 0x0bfc6105
16643 | bKGD | 6 | ...... | 0xa0bda793 16590 | bKGD | 6 | ...... | 0xa0bda793
16661 | pHYs | 9 | ...#...#. | 0x78a53f76 16608 | pHYs | 9 | ...#...#. | 0x78a53f76
16682 | tIME | 7 | ......2 | 0x582d32e4 16629 | tIME | 7 | ......2 | 0x582d32e4
16701 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5 16648 | zTXt | 278 | Comment..x.}..n.@....O..5..h.. | 0xdb1dfff5
16991 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c 16938 | IDAT | 8192 | x...k.%.u%....D......GWW...ER. | 0x929ed75c
25195 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0 25142 | IDAT | 8192 | .F('.T)/....D"]..."2 '(...D%.. | 0x52c572c0
33399 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb 33346 | IDAT | 8192 | y-.....>....3..p.....$....E.Bj | 0x65a90ffb
41603 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161 41550 | IDAT | 8192 | ....S....?..G.....G........... | 0xf44da161
49807 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574 49754 | IDAT | 7173 | .evl...3K..j.S.....x......Z .D | 0xbe6d3574
56992 | IEND | 0 | | 0xae426082 56939 | IEND | 0 | | 0xae426082
45ed3c125cc6041b37b44ee4cb881cd8 45ed3c125cc6041b37b44ee4cb881cd8
45ed3c125cc6041b37b44ee4cb881cd8 45ed3c125cc6041b37b44ee4cb881cd8
50b9125494306a6fc1b7c4f2a1a8d49d 50b9125494306a6fc1b7c4f2a1a8d49d

View File

@ -57,12 +57,12 @@ STRUCTURE OF PNG FILE: 1343_exif.png
address | chunk | length | data | checksum address | chunk | length | data | checksum
8 | IHDR | 13 | .......d.... | 0x4ce4e85c 8 | IHDR | 13 | .......d.... | 0x4ce4e85c
33 | iTXt | 39 | Description.....x.K.H.KOMQH... | 0xe0a1c8ce 33 | iTXt | 39 | Description.....x.K.H.KOMQH... | 0xe0a1c8ce
84 | zTXt | 145 | Raw profile type exif..x.U.... | 0x2f6d89e8 84 | eXIf | 108 | II*...............J.......... | 0xe863fbc7
241 | sRGB | 1 | | 0xaece1ce9 204 | sRGB | 1 | | 0xaece1ce9
254 | gAMA | 4 | .... | 0x0bfc6105 217 | gAMA | 4 | .... | 0x0bfc6105
270 | pHYs | 9 | ......... | 0xc76fa864 233 | pHYs | 9 | ......... | 0xc76fa864
291 | IDAT | 257 | x^..1..0......t.....h......z.. | 0x64465429 254 | IDAT | 257 | x^..1..0......t.....h......z.. | 0x64465429
560 | IEND | 0 | | 0xae426082 523 | IEND | 0 | | 0xae426082
changed comment changed comment
Exif.Image.ImageDescription Ascii 17 Can you read me? Exif.Image.ImageDescription Ascii 17 Can you read me?
Exif.Image.XResolution Rational 1 72 Exif.Image.XResolution Rational 1 72