#1108 and #1074 Correction to r4165 to fix MSVC build breaker and to document: exiv2 -eC (extract ICC profile).

v0.27.3
Robin Mills 10 years ago
parent fd5e983746
commit f49dd0b95f

@ -107,7 +107,7 @@ namespace Exiv2 {
@brief Print out the structure of a TIFF IFD @brief Print out the structure of a TIFF IFD
@caution This function is not thread safe. See TiffImage::printStructure for more details @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. @brief Not supported. TIFF format does not contain a comment.

@ -175,12 +175,12 @@ fmt Default format is %Y%m%d_%H%M%S.
lvl d | i | i | w | e lvl d | i | i | w | e
debug, info, warning, error debug, info, warning, error
mod s | a | t | v | h | i | x | c | p | i | C | R | S | X : mod s | a | t | v | h | i | x | c | p | i | C | R | S | X
summary, add, translated, vanilla, hex ... summary, all, translated, vanilla, hex iptc ,xmp, comment, preview,
iptc ,xmp, comment, preview, ICC, Recursive, Structure, raw XMP ICC Profile, Recursive Structure, Simple Structure, raw XMP
tgt a | c | e | i | t | x tgt a | c | e | i | t | x | C
all, comment, exif, iptc, thumb, xmp all, comment, exif, iptc, thumb, xmp, ICC Profile
.br .br
.fi .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 to extract. The available preview images and their numbers are displayed
with the 'print' option \fB\-pp\fP. with the 'print' option \fB\-pp\fP.
.sp 1 .sp 1
C : Extract embedded ICC profile to <file>.icc
.sp 1
X : Extract metadata to an XMP sidecar file <file>.xmp. The remaining X : Extract metadata to an XMP sidecar file <file>.xmp. The remaining
extract targets determine what metadata to extract to the sidecar extract targets determine what metadata to extract to the sidecar
file. Possible are Exif, IPTC and XMP and the default is all of these. file. Possible are Exif, IPTC and XMP and the default is all of these.

@ -652,13 +652,13 @@ namespace Exiv2 {
out << std::endl; out << std::endl;
// allocate storage and current file position // allocate storage and current file position
byte* exif = new byte[size]; byte* exif = new byte[size];
size_t restore = io_->tell(); uint32_t restore = io_->tell();
// copy the data to memory // copy the data to memory
io_->seek(-bufRead , BasicIo::cur); io_->seek(-bufRead , BasicIo::cur);
io_->read(exif,size); 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 // 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)); BasicIo::AutoPtr p = BasicIo::AutoPtr(new MemIo(exif+start,size-start));

@ -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; 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 // for XMP and ICC, back up and read the whole block
const char* key = "XML:com.adobe.xmp" ; const char* key = "XML:com.adobe.xmp" ;
size_t start = ::strlen(key); uint32_t start = (uint32_t) ::strlen(key);
if( (option == kpsXMP && dataString.find(key)==0) if( (option == kpsXMP && dataString.find(key)==0)
|| (option == kpsIccProfile && std::strcmp(chType,"iCCP")==0) || (option == kpsIccProfile && std::strcmp(chType,"iCCP")==0)
@ -222,7 +222,7 @@ namespace Exiv2 {
byte* icc = new byte[dataOffset]; byte* icc = new byte[dataOffset];
io_->read(icc,dataOffset); io_->read(icc,dataOffset);
DataBuf decompressed; 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); zlibUncompress(icc+name_l,dataOffset-name_l,decompressed);
out.write((const char*)decompressed.pData_,decompressed.size_); out.write((const char*)decompressed.pData_,decompressed.size_);
delete [] icc; delete [] icc;

@ -471,7 +471,7 @@ namespace Exiv2 {
printTiffStructure(io(),out,option,depth-1); 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++; depth++;
if ( option == kpsBasic || option == kpsRecursive ) { if ( option == kpsBasic || option == kpsRecursive ) {
@ -527,7 +527,8 @@ namespace Exiv2 {
if ( option == kpsBasic || option == kpsRecursive ) { if ( option == kpsBasic || option == kpsRecursive ) {
uint32_t address = start + 2 + i*12 ; 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) ){ if ( isShortType(type) ){
for ( uint16_t k = 0 ; k < kount ; k++ ) { for ( uint16_t k = 0 ; k < kount ; k++ ) {

Loading…
Cancel
Save