#1108 Add support to dump MakerNote IFDs with exiv2 -pR

v0.27.3
Robin Mills 9 years ago
parent 461b431bc1
commit 49fbd1d761

@ -442,10 +442,11 @@ namespace Exiv2 {
IptcData::printStructure(out,bytes,count,depth); IptcData::printStructure(out,bytes,count,depth);
delete[] bytes; // free delete[] bytes; // free
} else if ( option == kpsRecursive && tag == 0x927c /* MakerNote */ && count > 10) { } else if ( option == kpsRecursive && tag == 0x927c /* MakerNote */ && count > 10) {
size_t restore = io.tell(); // save
uint32_t jump= 10 ; uint32_t jump= 10 ;
byte bytes[20] ; byte bytes[20] ;
const char* chars = (const char*) &bytes[0] ; const char* chars = (const char*) &bytes[0] ;
size_t restore = io.tell(); // save
io.seek(offset,BasicIo::beg); // position io.seek(offset,BasicIo::beg); // position
io.read(bytes,jump ) ; // read io.read(bytes,jump ) ; // read
bytes[jump]=0 ; bytes[jump]=0 ;
@ -456,7 +457,12 @@ namespace Exiv2 {
MemIo memIo(bytes,count-jump) ; // create a file MemIo memIo(bytes,count-jump) ; // create a file
printTiffStructure(memIo,out,option,depth); printTiffStructure(memIo,out,option,depth);
delete[] bytes ; // free delete[] bytes ; // free
} else {
// tag is an IFD
io.seek(0,BasicIo::beg); // position
printIFDStructure(io,out,option,offset,bSwap,c,depth);
} }
io.seek(restore,BasicIo::beg); // restore io.seek(restore,BasicIo::beg); // restore
} }
} }

Loading…
Cancel
Save