From 49fbd1d761ee4f810df7ff56ea744f951c25d04f Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sun, 4 Dec 2016 06:02:44 +0000 Subject: [PATCH] #1108 Add support to dump MakerNote IFDs with exiv2 -pR --- src/image.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/image.cpp b/src/image.cpp index 8fa3fff5..01b6db7e 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -442,10 +442,11 @@ namespace Exiv2 { IptcData::printStructure(out,bytes,count,depth); delete[] bytes; // free } else if ( option == kpsRecursive && tag == 0x927c /* MakerNote */ && count > 10) { + size_t restore = io.tell(); // save + uint32_t jump= 10 ; byte bytes[20] ; const char* chars = (const char*) &bytes[0] ; - size_t restore = io.tell(); // save io.seek(offset,BasicIo::beg); // position io.read(bytes,jump ) ; // read bytes[jump]=0 ; @@ -456,7 +457,12 @@ namespace Exiv2 { MemIo memIo(bytes,count-jump) ; // create a file printTiffStructure(memIo,out,option,depth); 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 } }