[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:45:15 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=03aba63

The following commit has been merged in the master branch:
commit 03aba63de3f1ee16581bfe9f651a048921e6b1d9
Author: Robin Mills <robin at clanmills.com>
Date:   Fri May 1 11:36:26 2015 +0000

    #922 Submitting the fixed version of r3771
---
 src/pngimage.cpp                                |   2 +-
 src/tiffimage.cpp                               |  21 ++++++++++++++++-----
 test/bugfixes-test.sh                           |  11 ++++++++---
 test/data/bugfixes-test.out                     | Bin 1827317 -> 1838577 bytes
 test/data/{imagemagick.png => exiv2-bug922.png} | Bin 144766 -> 131388 bytes
 test/data/exiv2-bug922.tif                      | Bin 0 -> 7780 bytes
 test/data/exiv2-bug922a.jpg                     | Bin 0 -> 7169623 bytes
 7 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/src/pngimage.cpp b/src/pngimage.cpp
index 03f3964..3f746ce 100644
--- a/src/pngimage.cpp
+++ b/src/pngimage.cpp
@@ -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);
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index db96cce..9f67dbb 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -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
";
diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh
index edfd9b7..f79407d 100755
--- a/test/bugfixes-test.sh
+++ b/test/bugfixes-test.sh
@@ -268,11 +268,16 @@ source ./functions.source
 	filename=exiv2-bug$num.jpg
 	printf "$num " >&3
 	echo '------>' Bug $num '<-------' >&2
-	copyTestFile  $filename
-	runTest exiv2 -pX $filename
+	copyTestFile      $filename
+	runTest exiv2 -pX $filename ; echo '' # add a lf after the XMP/xml
 	filename=iptc-psAPP13-wIPTCempty-psAPP13-wIPTC.jpg
-	copyTestFile  $filename
+	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
diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out
index 6c2cd34..bc89940 100644
Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ
diff --git a/test/data/imagemagick.png b/test/data/exiv2-bug922.png
similarity index 83%
copy from test/data/imagemagick.png
copy to test/data/exiv2-bug922.png
index 88ae8c1..c068d8a 100644
Binary files a/test/data/imagemagick.png and b/test/data/exiv2-bug922.png differ
diff --git a/test/data/exiv2-bug922.tif b/test/data/exiv2-bug922.tif
new file mode 100755
index 0000000..b006201
Binary files /dev/null and b/test/data/exiv2-bug922.tif differ
diff --git a/test/data/exiv2-bug922a.jpg b/test/data/exiv2-bug922a.jpg
new file mode 100644
index 0000000..5a40a2e
Binary files /dev/null and b/test/data/exiv2-bug922a.jpg differ

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list