#2120 Fix submitted and appropriate changes to test/icc-test.sh (rewritting ICC in JPG was corrupting file)

v0.27.3
Robin Mills 9 years ago
parent 87e9c996a6
commit 57ee93886a

@ -604,6 +604,19 @@ namespace Exiv2 {
} }
} }
// which markers have a length field?
bool mHasLength[256];
for ( int marker = 0 ; marker < 256 ; marker ++ )
mHasLength[marker]
= ( marker >= sof0_ && marker <= sof15_)
|| ( marker >= app0_ && marker <= (app0_ | 0x0F))
|| marker == dht_
|| marker == dqt_
|| marker == dri_
|| marker == com_
|| marker == sos_
;
// Container for the signature // Container for the signature
bool bExtXMP = false; bool bExtXMP = false;
long bufRead = 0; long bufRead = 0;
@ -631,27 +644,10 @@ namespace Exiv2 {
bufRead = io_->read(buf.pData_, bufMinSize); bufRead = io_->read(buf.pData_, bufMinSize);
if (io_->error()) throw Error(14); if (io_->error()) throw Error(14);
if (bufRead < 2) throw Error(15); if (bufRead < 2) throw Error(15);
uint16_t size = 0; uint16_t size = mHasLength[marker] ? getUShort(buf.pData_, bigEndian) : 0 ;
if ( bPrint && mHasLength[marker] ) out << Internal::stringFormat(" | %7d ", size);
// not all markers have size field. // print signature for APPn
if( ( marker >= sof0_ && marker <= sof15_)
|| ( marker >= app0_ && marker <= (app0_ | 0x0F))
|| marker == dht_
|| marker == dqt_
|| marker == dri_
|| marker == com_
|| marker == sos_
){
size = getUShort(buf.pData_, bigEndian);
}
if ( bPrint ) out << Internal::stringFormat(" | %7d ", size);
if ( bPrint && marker == com_ ) {
int n = size>32?32:size;
if (n>3) n-=3; // three trailing bytes in a com
out << "| " << Internal::binaryToString(buf,n,2);
}
// only print the signature for appn
if (marker >= app0_ && marker <= (app0_ | 0x0F)) { if (marker >= app0_ && marker <= (app0_ | 0x0F)) {
// http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart3.pdf p75 // http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart3.pdf p75
const char* signature = (const char*) buf.pData_+2; const char* signature = (const char*) buf.pData_+2;
@ -696,13 +692,12 @@ namespace Exiv2 {
} else if ( option == kpsIccProfile && std::strcmp(signature,iccId_) == 0 ) { } else if ( option == kpsIccProfile && std::strcmp(signature,iccId_) == 0 ) {
// extract ICCProfile // extract ICCProfile
if ( size > 0 ) { if ( size > 0 ) {
io_->seek(-bufRead , BasicIo::cur); io_->seek(-bufRead , BasicIo::cur); // back to buffer (after marker+size)
byte* icc = new byte[size]; io_->seek( 16 , BasicIo::cur); // step over header
io_->read(icc,size); DataBuf icc(size-2-16);
std::size_t start=16; io_->read( icc.pData_,icc.size_);
out.write( ((const char*)icc)+start,size-start); out.write((const char*)icc.pData_,icc.size_);
bufRead = size; bufRead = size;
delete [] icc;
} }
} else if ( option == kpsIptcErase && std::strcmp(signature,"Photoshop 3.0") == 0 ) { } else if ( option == kpsIptcErase && std::strcmp(signature,"Photoshop 3.0") == 0 ) {
// delete IPTC data segment from JPEG // delete IPTC data segment from JPEG
@ -779,28 +774,28 @@ namespace Exiv2 {
io_->seek(restore,Exiv2::BasicIo::beg); io_->seek(restore,Exiv2::BasicIo::beg);
delete [] exif; delete [] exif;
bLF = false; bLF = false;
} }
} }
} }
// print COM marker
if ( bPrint && marker == com_ ) {
int n = (size-2)>32?32:size-2; // size includes 2 for the two bytes for size!
out << "| " << Internal::binaryToString(buf,n,2); // start after the two bytes
}
// Skip the segment if the size is known // Skip the segment if the size is known
if (io_->seek(size - bufRead, BasicIo::cur)) throw Error(14); if (io_->seek(size - bufRead, BasicIo::cur)) throw Error(14);
if ( bLF ) out << std::endl; if ( bLF ) out << std::endl;
if (marker == sos_) if (marker != sos_) {
// sos_ is immediately followed by entropy-coded data & eoi_
done = true;
else {
// Read the beginning of the next segment // Read the beginning of the next segment
marker = advanceToMarker(); marker = advanceToMarker();
REPORT_MARKER; REPORT_MARKER;
if ( marker == eoi_ ) {
if ( option == kpsBasic ) out << std::endl;
done = true;
}
} }
done = marker == eoi_ || marker == sos_;
if ( done ) out << std::endl;
} }
} }
if ( option == kpsIptcErase && iptcDataSegs.size() ) { if ( option == kpsIptcErase && iptcDataSegs.size() ) {
@ -1097,7 +1092,7 @@ namespace Exiv2 {
tmpBuf[0] = 0xff; tmpBuf[0] = 0xff;
tmpBuf[1] = app2_; tmpBuf[1] = app2_;
int chunk_size = 256*256-18 ; // leave bytes for marker and header int chunk_size = 256*256-40 ; // leave bytes for marker and header
int size = (int) iccProfile_.size_ ; int size = (int) iccProfile_.size_ ;
int chunks = 1 + (size-1) / chunk_size ; int chunks = 1 + (size-1) / chunk_size ;
if (iccProfile_.size_ > 256*chunk_size) throw Error(37, "IccProfile"); if (iccProfile_.size_ > 256*chunk_size) throw Error(37, "IccProfile");
@ -1106,8 +1101,10 @@ namespace Exiv2 {
size -= bytes ; size -= bytes ;
// write JPEG marker (2 bytes) // write JPEG marker (2 bytes)
us2Data(tmpBuf + 2, 16 + bytes, bigEndian); if (outIo.write(tmpBuf, 2) != 2) throw Error(21); // JPEG Marker
if (outIo.write(tmpBuf, 4) != 4) throw Error(21); // JPEG Marker // write length (2 bytes). length includes the 2 bytes for the length
us2Data(tmpBuf + 2, 2+16+bytes, bigEndian);
if (outIo.write(tmpBuf+2, 2) != 2) throw Error(21); // JPEG Length
// write the ICC_PROFILE header (16 bytes) // write the ICC_PROFILE header (16 bytes)
char pad[4]; char pad[4];
@ -1115,8 +1112,8 @@ namespace Exiv2 {
pad[1] = chunks; pad[1] = chunks;
pad[2] = 0; pad[2] = 0;
pad[3] = 0; pad[3] = 0;
outIo.write((const byte *) iccId_,(long) ::strlen(iccId_) + 1); outIo.write((const byte *) iccId_,12);
outIo.write((const byte *) pad, sizeof(pad)); outIo.write((const byte *) pad, 4);
if (outIo.write(iccProfile_.pData_+ (chunk*chunk_size), bytes) != bytes) if (outIo.write(iccProfile_.pData_+ (chunk*chunk_size), bytes) != bytes)
throw Error(21); throw Error(21);
if (outIo.error()) throw Error(21); if (outIo.error()) throw Error(21);

Binary file not shown.

@ -1,6 +1,6 @@
STRUCTURE OF JPEG FILE: Reagan.jpg STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data address | marker | length | data
0 | 0xffd8 SOI | 0 0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,.... 2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5671 | Exif..MM.*...................... 20 | 0xffe1 APP1 | 5671 | Exif..MM.*......................
5693 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z... 5693 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
@ -11,62 +11,200 @@ STRUCTURE OF JPEG FILE: Reagan.jpg
25665 | 0xffc0 SOF0 | 17 25665 | 0xffc0 SOF0 | 17
25684 | 0xffdd DRI | 4 25684 | 0xffdd DRI | 4
25690 | 0xffc4 DHT | 418 25690 | 0xffc4 DHT | 418
26110 | 0xffda SOS | 12 26110 | 0xffda SOS
STRUCTURE OF JPEG FILE: Reagan.jpg STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data address | marker | length | data
0 | 0xffd8 SOI | 0 0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,.... 2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*...................... 20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x 5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 65534 | ICC_PROFILE........ APPL....prtr chunk 1/25 12706 | 0xffe2 APP2 | 3161 | ICC_PROFILE........HLino....mntr chunk 1/1
78244 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....o.S...r.R...t.RT chunk 2/25 15869 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
143782 | 0xffe2 APP2 | 65534 | ICC_PROFILE.........o..b.tn..Q.K chunk 3/25 25465 | 0xffee APP14 | 14 | Adobe.d@......
209320 | 0xffe2 APP2 | 65534 | ICC_PROFILE.......n.....l>...... chunk 4/25 25481 | 0xffdb DQT | 132
274858 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....W8w;.QY2w$.gZ.wY chunk 5/25 25615 | 0xfffe COM | 10 | abcdefg
340396 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....Y1...]W.j....QlT chunk 6/25 25627 | 0xffc0 SOF0 | 17
405934 | 0xffe2 APP2 | 65534 | ICC_PROFILE......ik.....j;....h. chunk 7/25 25646 | 0xffdd DRI | 4
471472 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....a.r2GRW.M...Y.MX chunk 8/25 25652 | 0xffc4 DHT | 418
537010 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....`...bs]...dDZ7.b chunk 9/25 26072 | 0xffda SOS
602548 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....d.}...f.z...hRv. chunk 10/25 abcdefg
668086 | 0xffe2 APP2 | 65534 | ICC_PROFILE.......y+...^yy....y. chunk 11/25 STRUCTURE OF JPEG FILE: Reagan.jpg
733624 | 0xffe2 APP2 | 65534 | ICC_PROFILE......v.-i.....kN...< chunk 12/25 address | marker | length | data
799162 | 0xffe2 APP2 | 65534 | ICC_PROFILE......'Z.....M.....>. chunk 13/25 0 | 0xffd8 SOI
864700 | 0xffe2 APP2 | 65534 | ICC_PROFILE..................... chunk 14/25 2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
930238 | 0xffe2 APP2 | 65534 | ICC_PROFILE........D..........". chunk 15/25 20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
995776 | 0xffe2 APP2 | 65534 | ICC_PROFILE.......V[*+..7.,G..'. chunk 16/25 5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
1061314 | 0xffe2 APP2 | 65534 | ICC_PROFILE......Z...G.....C.... chunk 17/25 12706 | 0xffe2 APP2 | 3162 | ICC_PROFILE..........HLino....mn chunk 1/1
1126852 | 0xffe2 APP2 | 65534 | ICC_PROFILE......2yg.Te....VG... chunk 18/25 15870 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
1192390 | 0xffe2 APP2 | 65534 | ICC_PROFILE..................... chunk 19/25 25466 | 0xffee APP14 | 14 | Adobe.d@......
1257928 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....1.0.285.0.373.0. chunk 20/25 25482 | 0xffdb DQT | 132
1323466 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....0.260.0.271.0.27 chunk 21/25 25616 | 0xffc0 SOF0 | 17
1389004 | 0xffe2 APP2 | 65534 | ICC_PROFILE.....39.0.145.0.150.0 chunk 22/25 25635 | 0xffdd DRI | 4
1454542 | 0xffe2 APP2 | 65534 | ICC_PROFILE......0.051.0.060.0.0 chunk 23/25 25641 | 0xffc4 DHT | 418
1520080 | 0xffe2 APP2 | 65534 | ICC_PROFILE......0.743.0.788.0.8 chunk 24/25 26061 | 0xffda SOS
1585618 | 0xffe2 APP2 | 41184 | ICC_PROFILE......452.0.452.0.464 chunk 25/25 STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data
0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 65514 | ICC_PROFILE........ APPL....prtr chunk 1/25
78222 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....X..Ih.V...j.U..4 chunk 2/25
143738 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....}.f...~mcx...`. chunk 3/25
209254 | 0xffe2 APP2 | 65514 | ICC_PROFILE......|...S...^...v.. chunk 4/25
274770 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......bXf2..`Og...^0 chunk 5/25
340286 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......~.|...{.}P..y. chunk 6/25
405802 | 0xffe2 APP2 | 65514 | ICC_PROFILE........b.....:...?.. chunk 7/25
471318 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....Q8yq].R.wW].S.uJ chunk 8/25
536834 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....i.T'..RA.Y..P,.. chunk 9/25
602350 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....i.}/..key...l.v. chunk 10/25
667866 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....{....O{.....|..c chunk 11/25
733382 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....E.;.O-F.-.R>J... chunk 12/25
798898 | 0xffe2 APP2 | 65514 | ICC_PROFILE......X..up.......... chunk 13/25
864414 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........<.......... chunk 14/25
929930 | 0xffe2 APP2 | 65514 | ICC_PROFILE................,...' chunk 15/25
995446 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........g.....m%... chunk 16/25
1060962 | 0xffe2 APP2 | 65514 | ICC_PROFILE........s....xX.M..n. chunk 17/25
1126478 | 0xffe2 APP2 | 65514 | ICC_PROFILE..............0...... chunk 18/25
1191994 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........(.n.B...... chunk 19/25
1257510 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....0.0.282.0.282.0. chunk 20/25
1323026 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....175.0.176.0.175. chunk 21/25
1388542 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....103.0.114.0.126. chunk 22/25
1454058 | 0xffe2 APP2 | 65514 | ICC_PROFILE.....6.0.049.0.053.0. chunk 23/25
1519574 | 0xffe2 APP2 | 65514 | ICC_PROFILE......0.670.0.653.0.6 chunk 24/25
1585090 | 0xffe2 APP2 | 41714 | ICC_PROFILE.....09.0.584.0.555.0 chunk 25/25
1626806 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z... 1626806 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
1636402 | 0xffee APP14 | 14 | Adobe.d@...... 1636402 | 0xffee APP14 | 14 | Adobe.d@......
1636418 | 0xffdb DQT | 132 1636418 | 0xffdb DQT | 132
1636552 | 0xffc0 SOF0 | 17 1636552 | 0xffc0 SOF0 | 17
1636571 | 0xffdd DRI | 4 1636571 | 0xffdd DRI | 4
1636577 | 0xffc4 DHT | 418 1636577 | 0xffc4 DHT | 418
1636997 | 0xffda SOS | 12 1636997 | 0xffda SOS
STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data
0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......... APPL....pr chunk 1/25
78222 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......X..Ih.V...j.U. chunk 2/25
143738 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......}.f...~mcx... chunk 3/25
209254 | 0xffe2 APP2 | 65514 | ICC_PROFILE........|...S...^...v chunk 4/25
274770 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........bXf2..`Og... chunk 5/25
340286 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........~.|...{.}P.. chunk 6/25
405802 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........b.....:...? chunk 7/25
471318 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......Q8yq].R.wW].S. chunk 8/25
536834 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......i.T'..RA.Y..P, chunk 9/25
602350 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......i.}/..key...l. chunk 10/25
667866 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......{....O{.....|. chunk 11/25
733382 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......E.;.O-F.-.R>J. chunk 12/25
798898 | 0xffe2 APP2 | 65514 | ICC_PROFILE........X..up........ chunk 13/25
864414 | 0xffe2 APP2 | 65514 | ICC_PROFILE............<........ chunk 14/25
929930 | 0xffe2 APP2 | 65514 | ICC_PROFILE..................,.. chunk 15/25
995446 | 0xffe2 APP2 | 65514 | ICC_PROFILE...........g.....m%.. chunk 16/25
1060962 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........s....xX.M.. chunk 17/25
1126478 | 0xffe2 APP2 | 65514 | ICC_PROFILE................0.... chunk 18/25
1191994 | 0xffe2 APP2 | 65514 | ICC_PROFILE............(.n.B.... chunk 19/25
1257510 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......0.0.282.0.282. chunk 20/25
1323026 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......175.0.176.0.17 chunk 21/25
1388542 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......103.0.114.0.12 chunk 22/25
1454058 | 0xffe2 APP2 | 65514 | ICC_PROFILE.......6.0.049.0.053. chunk 23/25
1519574 | 0xffe2 APP2 | 65514 | ICC_PROFILE........0.670.0.653.0 chunk 24/25
1585090 | 0xffe2 APP2 | 41715 | ICC_PROFILE.......09.0.584.0.555 chunk 25/25
1626807 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
1636403 | 0xffee APP14 | 14 | Adobe.d@......
1636419 | 0xffdb DQT | 132
1636553 | 0xfffe COM | 10 | abcdefg
1636565 | 0xffc0 SOF0 | 17
1636584 | 0xffdd DRI | 4
1636590 | 0xffc4 DHT | 418
1637010 | 0xffda SOS
abcdefg
STRUCTURE OF JPEG FILE: Reagan.jpg STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data address | marker | length | data
0 | 0xffd8 SOI | 0 0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 65514 | ICC_PROFILE............ APPL... chunk 1/25
78222 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........X..Ih.V...j. chunk 2/25
143738 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........}.f...~mcx.. chunk 3/25
209254 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........|...S...^.. chunk 4/25
274770 | 0xffe2 APP2 | 65514 | ICC_PROFILE...........bXf2..`Og. chunk 5/25
340286 | 0xffe2 APP2 | 65514 | ICC_PROFILE...........~.|...{.}P chunk 6/25
405802 | 0xffe2 APP2 | 65514 | ICC_PROFILE............b.....:.. chunk 7/25
471318 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........Q8yq].R.wW]. chunk 8/25
536834 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........i.T'..RA.Y.. chunk 9/25
602350 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........i.}/..key... chunk 10/25
667866 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........{....O{..... chunk 11/25
733382 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........E.;.O-F.-.R> chunk 12/25
798898 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........X..up...... chunk 13/25
864414 | 0xffe2 APP2 | 65514 | ICC_PROFILE..............<...... chunk 14/25
929930 | 0xffe2 APP2 | 65514 | ICC_PROFILE...................., chunk 15/25
995446 | 0xffe2 APP2 | 65514 | ICC_PROFILE.............g.....m% chunk 16/25
1060962 | 0xffe2 APP2 | 65514 | ICC_PROFILE............s....xX.M chunk 17/25
1126478 | 0xffe2 APP2 | 65514 | ICC_PROFILE..................0.. chunk 18/25
1191994 | 0xffe2 APP2 | 65514 | ICC_PROFILE..............(.n.B.. chunk 19/25
1257510 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........0.0.282.0.28 chunk 20/25
1323026 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........175.0.176.0. chunk 21/25
1388542 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........103.0.114.0. chunk 22/25
1454058 | 0xffe2 APP2 | 65514 | ICC_PROFILE.........6.0.049.0.05 chunk 23/25
1519574 | 0xffe2 APP2 | 65514 | ICC_PROFILE..........0.670.0.653 chunk 24/25
1585090 | 0xffe2 APP2 | 41716 | ICC_PROFILE.........09.0.584.0.5 chunk 25/25
1626808 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
1636404 | 0xffee APP14 | 14 | Adobe.d@......
1636420 | 0xffdb DQT | 132
1636554 | 0xffc0 SOF0 | 17
1636573 | 0xffdd DRI | 4
1636579 | 0xffc4 DHT | 418
1636999 | 0xffda SOS
STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data
0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,.... 2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*...................... 20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x 5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 3160 | ICC_PROFILE........HLino....mntr chunk 1/1 12706 | 0xffe2 APP2 | 3160 | ICC_PROFILE........HLino....mntr chunk 1/1
15868 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
25464 | 0xffee APP14 | 14 | Adobe.d@......
25480 | 0xffdb DQT | 132
25614 | 0xffc0 SOF0 | 17
25633 | 0xffdd DRI | 4
25639 | 0xffc4 DHT | 418
26059 | 0xffda SOS
STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data
0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 3161 | ICC_PROFILE..........HLino....mn chunk 1/1
15869 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
25465 | 0xffee APP14 | 14 | Adobe.d@......
25481 | 0xffdb DQT | 132
25615 | 0xfffe COM | 10 | abcdefg
25627 | 0xffc0 SOF0 | 17
25646 | 0xffdd DRI | 4
25652 | 0xffc4 DHT | 418
26072 | 0xffda SOS
abcdefg
STRUCTURE OF JPEG FILE: Reagan.jpg
address | marker | length | data
0 | 0xffd8 SOI
2 | 0xffe0 APP0 | 16 | JFIF.....,.,....
20 | 0xffe1 APP1 | 5658 | Exif..MM.*......................
5680 | 0xffe1 APP1 | 7024 | http://ns.adobe.com/xap/1.0/.<?x
12706 | 0xffe2 APP2 | 3162 | ICC_PROFILE............HLino... chunk 1/1
15870 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z... 15870 | 0xffed APP13 | 9594 | Photoshop 3.0.8BIM..........Z...
25466 | 0xffee APP14 | 14 | Adobe.d@...... 25466 | 0xffee APP14 | 14 | Adobe.d@......
25482 | 0xffdb DQT | 132 25482 | 0xffdb DQT | 132
25616 | 0xffc0 SOF0 | 17 25616 | 0xffc0 SOF0 | 17
25635 | 0xffdd DRI | 4 25635 | 0xffdd DRI | 4
25641 | 0xffc4 DHT | 418 25641 | 0xffc4 DHT | 418
26061 | 0xffda SOS | 12 26061 | 0xffda SOS
md5: reagan1_.icc: No such file or directory MD5 (reagan_1.icc) = 264d91010fb585eeae33a8eeeaa0495f
md5: reagan2_.icc: No such file or directory MD5 (reagan_2.icc) = 264d91010fb585eeae33a8eeeaa0495f
md5: small1_.icc: No such file or directory MD5 (small_1.icc) = 75e766757c564c6c4305be96914ea923
md5: small2_.icc: No such file or directory MD5 (small_2.icc) = 75e766757c564c6c4305be96914ea923
md5: big1_.icc: No such file or directory MD5 (big_1.icc) = 1cb491b91a36649ef694c20f493e5d55
md5: big2_.icc: No such file or directory MD5 (big_2.icc) = 1cb491b91a36649ef694c20f493e5d55

Binary file not shown.

@ -344,7 +344,7 @@ STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
ICCP | 560 | 30 | ...0ADBE....mntrRGB XYZ ........ ICCP | 560 | 30 | ...0ADBE....mntrRGB XYZ ........
VP8 | 172008 | 598 | .G...*.. .>1..B.!..o.. ......].. VP8 | 172008 | 598 | .G...*.. .>1..B.!..o.. ......]..
EXIF | 12040 | 172614 | II*........................... . EXIF | 12040 | 172614 | II*........................... .
XMP | 1677405 | 184662 | <x:xmpmeta xmlns:x="adobe:ns:met XMP | 1677406 | 184662 | <x:xmpmeta xmlns:x="adobe:ns:met
STRUCTURE OF WEBP FILE: exiv2-bug1199.webp STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
Chunk | Length | Offset | Payload Chunk | Length | Offset | Payload
RIFF | 187526 | 0 | WEBP RIFF | 187526 | 0 | WEBP

@ -3,6 +3,15 @@
source ./functions.source source ./functions.source
test2120() # --comment and -dc clobbered by writing ICC/JPG
{
runTest exiv2 --comment abcdefg $filename
runTest exiv2 -pS $filename
runTest exiv2 -pc $filename
runTest exiv2 -dc $filename
runTest exiv2 -pS $filename
}
( cd "$testdir" ( cd "$testdir"
num=1074 # ICC Profile Support num=1074 # ICC Profile Support
@ -16,6 +25,7 @@ source ./functions.source
runTest exiv2 -pC $filename > reagan_1.icc runTest exiv2 -pC $filename > reagan_1.icc
runTest exiv2 -eC --force $filename runTest exiv2 -eC --force $filename
mv $iccname_ reagan_2.icc mv $iccname_ reagan_2.icc
test2120
copyTestFile big.icc $iccname_ copyTestFile big.icc $iccname_
runTest exiv2 -iC $filename runTest exiv2 -iC $filename
@ -23,19 +33,24 @@ source ./functions.source
runTest exiv2 -pS $filename runTest exiv2 -pS $filename
runTest exiv2 -eC --force $filename runTest exiv2 -eC --force $filename
mv $iccname_ big_2.icc mv $iccname_ big_2.icc
test2120
copyTestFile small.icc $iccname_ copyTestFile small.icc $iccname_
runTest exiv2 -iC $filename runTest exiv2 -iC $filename
runTest exiv2 -pC $filename > small_.icc runTest exiv2 -pC $filename > small_1.icc
runTest exiv2 -pS $filename runTest exiv2 -pS $filename
runTest exiv2 -eC --force $filename runTest exiv2 -eC --force $filename
mv $iccname_ small_2.icc mv $iccname_ small_2.icc
test2120
for f in reagan small big; do for i in 1 2; do for f in reagan small big; do for i in 1 2; do
md5 ${f}${i}_.icc md5 ${f}_${i}.icc
done ; done done ; done
) 3>&1 > $results 2>&1 ) 3>&1 > $results 2>&1
printf "\n" printf "\n"

Loading…
Cancel
Save