From f49dd0b95f9018026d1cb2e630eace207b7f21c3 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 5 Jan 2016 16:52:36 +0000 Subject: [PATCH] #1108 and #1074 Correction to r4165 to fix MSVC build breaker and to document: exiv2 -eC (extract ICC profile). --- include/exiv2/tiffimage.hpp | 2 +- src/exiv2.1 | 12 +++++++----- src/jpgimage.cpp | 6 +++--- src/pngimage.cpp | 6 +++--- src/tiffimage.cpp | 5 +++-- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/exiv2/tiffimage.hpp b/include/exiv2/tiffimage.hpp index 76c1af71..a5e210cd 100644 --- a/include/exiv2/tiffimage.hpp +++ b/include/exiv2/tiffimage.hpp @@ -107,7 +107,7 @@ namespace Exiv2 { @brief Print out the structure of a TIFF IFD @caution This function is not thread safe. See TiffImage::printStructure for more details */ - static void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,size_t start,bool bSwap,char c,int depth); + static void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth); /*! @brief Not supported. TIFF format does not contain a comment. diff --git a/src/exiv2.1 b/src/exiv2.1 index 28f92ee9..c1bd8af5 100644 --- a/src/exiv2.1 +++ b/src/exiv2.1 @@ -175,12 +175,12 @@ fmt Default format is %Y%m%d_%H%M%S. lvl d | i | i | w | e debug, info, warning, error -mod s | a | t | v | h | i | x | c | p | i | C | R | S | X : - summary, add, translated, vanilla, hex ... - iptc ,xmp, comment, preview, ICC, Recursive, Structure, raw XMP +mod s | a | t | v | h | i | x | c | p | i | C | R | S | X + summary, all, translated, vanilla, hex iptc ,xmp, comment, preview, + ICC Profile, Recursive Structure, Simple Structure, raw XMP -tgt a | c | e | i | t | x - all, comment, exif, iptc, thumb, xmp +tgt a | c | e | i | t | x | C + all, comment, exif, iptc, thumb, xmp, ICC Profile .br .fi @@ -400,6 +400,8 @@ list of preview image numbers is used to determine which preview images to extract. The available preview images and their numbers are displayed with the 'print' option \fB\-pp\fP. .sp 1 +C : Extract embedded ICC profile to .icc +.sp 1 X : Extract metadata to an XMP sidecar file .xmp. The remaining extract targets determine what metadata to extract to the sidecar file. Possible are Exif, IPTC and XMP and the default is all of these. diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index 2f465eca..83e59667 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -652,13 +652,13 @@ namespace Exiv2 { out << std::endl; // allocate storage and current file position - byte* exif = new byte[size]; - size_t restore = io_->tell(); + byte* exif = new byte[size]; + uint32_t restore = io_->tell(); // copy the data to memory io_->seek(-bufRead , BasicIo::cur); io_->read(exif,size); - std::size_t start = std::strcmp(http,"Exif")==0 ? 8 : 6; + uint32_t start = std::strcmp(http,"Exif")==0 ? 8 : 6; // create a copy on write memio object with the data, then print the structure BasicIo::AutoPtr p = BasicIo::AutoPtr(new MemIo(exif+start,size-start)); diff --git a/src/pngimage.cpp b/src/pngimage.cpp index 79d34b90..c1aab1b0 100644 --- a/src/pngimage.cpp +++ b/src/pngimage.cpp @@ -198,8 +198,8 @@ namespace Exiv2 { if ( option == kpsBasic ) out << Internal::stringFormat("%8d | %5d | %10s |%8d | ",(uint32_t)address, index++,chType,dOff) << dataString << std::endl; // for XMP and ICC, back up and read the whole block - const char* key = "XML:com.adobe.xmp" ; - size_t start = ::strlen(key); + const char* key = "XML:com.adobe.xmp" ; + uint32_t start = (uint32_t) ::strlen(key); if( (option == kpsXMP && dataString.find(key)==0) || (option == kpsIccProfile && std::strcmp(chType,"iCCP")==0) @@ -222,7 +222,7 @@ namespace Exiv2 { byte* icc = new byte[dataOffset]; io_->read(icc,dataOffset); DataBuf decompressed; - size_t name_l = std::strlen((const char*)icc)+1; // length of profile name + uint32_t name_l = (uint32_t) std::strlen((const char*)icc)+1; // length of profile name zlibUncompress(icc+name_l,dataOffset-name_l,decompressed); out.write((const char*)decompressed.pData_,decompressed.size_); delete [] icc; diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp index bb8a5ff5..e9425e4f 100644 --- a/src/tiffimage.cpp +++ b/src/tiffimage.cpp @@ -471,7 +471,7 @@ namespace Exiv2 { printTiffStructure(io(),out,option,depth-1); } - void TiffImage::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,size_t start,bool bSwap,char c,int depth) + void TiffImage::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth) { depth++; if ( option == kpsBasic || option == kpsRecursive ) { @@ -527,7 +527,8 @@ namespace Exiv2 { if ( option == kpsBasic || option == kpsRecursive ) { uint32_t address = start + 2 + i*12 ; - out << indent(depth) << Internal::stringFormat("%8u | %#06x %-25s |%10s |%9u |%9u | ",address,tag,tagName(tag,25),typeName(type),count,offset); + out << indent(depth) << Internal::stringFormat("%8u | %#06x %-25s |%10s |%9u |%9u | " + ,address,tag,tagName(tag,25),typeName(type),count,offset); if ( isShortType(type) ){ for ( uint16_t k = 0 ; k < kount ; k++ ) {