#922 Submitting the fixed version of r3771

v0.27.3
Robin Mills 10 years ago
parent 2712082555
commit 03aba63de3

@ -148,7 +148,7 @@ namespace Exiv2 {
dataString = binaryToString(buff,blen);
}
if ( option == kpsBasic ) out << stringFormat("%8lu | %5ld | %10s |%8lu | ",(uint32_t)address, index++,chType,dOff) << dataString << std::endl;
if ( option == kpsBasic ) out << stringFormat("%8d | %5d | %10s |%8d | ",(uint32_t)address, index++,chType,dOff) << dataString << std::endl;
// for XMP, back up and read the whole block
const char* key = "XML:com.adobe.xmp" ;
size_t start = ::strlen(key);

@ -302,6 +302,18 @@ namespace Exiv2 {
return rc;
}
bool isBigEndian()
{
union {
uint32_t i;
char c[4];
} e = { 0x01000000 };
return e.c[0]?true:false;
}
bool isLittleEndian() { return !isBigEndian(); }
// http://en.wikipedia.org/wiki/Endianness
static uint32_t byteSwap(uint32_t value,bool bSwap)
{
@ -451,11 +463,10 @@ namespace Exiv2 {
// read header (we already know for certain that we have a Tiff file)
io_->read(dir.pData_, 8);
char c = (char) dir.pData_[0] ;
#if __LITTLE_ENDIAN__
bool bSwap = c == 'M';
#else
bool bSwap = c == 'I';
#endif
bool bSwap = ( c == 'M' && isLittleEndian() )
|| ( c == 'I' && isBigEndian() )
;
if ( option == kpsBasic ) {
out << stringFormat("STRUCTURE OF TIFF FILE (%c%c): ",c,c) << io_->path() << std::endl;
out << " address | tag | type | count | offset | value\n";

@ -269,10 +269,15 @@ source ./functions.source
printf "$num " >&3
echo '------>' Bug $num '<-------' >&2
copyTestFile $filename
runTest exiv2 -pX $filename
runTest exiv2 -pX $filename ; echo '' # add a lf after the XMP/xml
filename=iptc-psAPP13-wIPTCempty-psAPP13-wIPTC.jpg
copyTestFile $filename
runTest exiv2 -pX $filename
for filename in exiv2-bug$num.png exiv2-bug$num.tif exiv2-bug${num}a.jpg; do
copyTestFile $filename ;
runTest exiv2 -pX $filename ; echo ''
runTest exiv2 -pS $filename
done
num=937
filename=exiv2-bug$num.jpg

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Loading…
Cancel
Save