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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:39:43 UTC 2017


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

The following commit has been merged in the master branch:
commit 533b3d224a3c30836b0836a054bee193a695d84a
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Aug 17 15:55:18 2008 +0000

    Added write-support for tiled images. Aligned every strip (tile) of the image data.
---
 src/tiffcomposite.cpp   | 13 ++++++++-----
 src/tiffimage.cpp       | 10 ++++++++++
 test/data/tiff-test.out |  4 ++--
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index 587f525..be72f1a 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -906,8 +906,8 @@ namespace Exiv2 {
         for (Strips::const_iterator i = strips_.begin(); i != strips_.end(); ++i) {
             idx += writeOffset(buf.pData_ + idx, imageIdx, tiffType(), byteOrder);
             imageIdx += i->second;
+            imageIdx += i->second & 1;      // Align strip data to word boundary
         }
-        imageIdx += sizeImage() & 1;                // Align image data to word boundary
         append(blob, buf.pData_, buf.size_);
         return buf.size_;
     } // TiffImageEntry::doWrite
@@ -1122,9 +1122,6 @@ namespace Exiv2 {
         if (blob.capacity() - size < sz) {
             blob.reserve(size + sz + 65536);
         }
-        // Align image data to word boundary
-        uint32_t align = (blob.size() & 1);
-        if (align) blob.push_back(0x0);
 
         uint32_t len = pValue()->sizeDataArea();
         if (len > 0) {
@@ -1135,6 +1132,9 @@ namespace Exiv2 {
 #endif
             DataBuf buf = pValue()->dataArea();
             append(blob, buf.pData_, buf.size_);
+            uint32_t align = len & 1;       // Align image data to word boundary
+            if (align) blob.push_back(0x0);
+            len += align;
         }
         else {
 #ifdef DEBUG
@@ -1146,12 +1146,15 @@ namespace Exiv2 {
             for (Strips::const_iterator i = strips_.begin(); i != strips_.end(); ++i) {
                 append(blob, i->first, i->second);
                 len += i->second;
+                uint32_t align = i->second & 1; // Align strip data to word boundary
+                if (align) blob.push_back(0x0);
+                len += align;
             }
         }
 #ifdef DEBUG
         std::cerr << ", len = " << len << " bytes
";
 #endif
-        return len + align;
+        return len;
     } // TiffImageEntry::doWriteImage
 
     uint32_t TiffComponent::size() const
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index f280ac7..0ebb3e1 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -288,6 +288,8 @@ namespace Exiv2 {
         {    0x8825, Group::ifd0,      Group::gps,       Tag::root, Group::none,      newTiffSubIfd },
         {    0x0111, Group::ifd0,      Group::ifd0,      Tag::root, Group::none,      newTiffImageData<0x0117, Group::ifd0> },
         {    0x0117, Group::ifd0,      Group::ifd0,      Tag::root, Group::none,      newTiffImageSize<0x0111, Group::ifd0> },
+        {    0x0144, Group::ifd0,      Group::ifd0,      Tag::root, Group::none,      newTiffImageData<0x0145, Group::ifd0> },
+        {    0x0145, Group::ifd0,      Group::ifd0,      Tag::root, Group::none,      newTiffImageSize<0x0144, Group::ifd0> },
         {    0x0201, Group::ifd0,      Group::ifd0,      Tag::root, Group::ifd0,      newTiffImageData<0x0202, Group::ifd0> },
         {    0x0202, Group::ifd0,      Group::ifd0,      Tag::root, Group::ifd0,      newTiffImageSize<0x0201, Group::ifd0> },
         {    0x014a, Group::ifd0,      Group::subimg1,   Tag::root, Group::none,      newTiffSubIfd },
@@ -297,6 +299,8 @@ namespace Exiv2 {
         // Subdir subimg1
         {    0x0111, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageData<0x0117, Group::subimg1> },
         {    0x0117, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageSize<0x0111, Group::subimg1> },
+        {    0x0144, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageData<0x0145, Group::subimg1> },
+        {    0x0145, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageSize<0x0144, Group::subimg1> },
         {    0x0201, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageData<0x0202, Group::subimg1> },
         {    0x0202, Group::subimg1,   Group::subimg1,   0x014a,    Group::ifd0,      newTiffImageSize<0x0201, Group::subimg1> },
         { Tag::next, Group::subimg1,   Group::ignr,      0x014a,    Group::ifd0,      newTiffDirectory },
@@ -305,6 +309,8 @@ namespace Exiv2 {
         // Subdir subimg2
         {    0x0111, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageData<0x0117, Group::subimg2> },
         {    0x0117, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageSize<0x0111, Group::subimg2> },
+        {    0x0144, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageData<0x0145, Group::subimg2> },
+        {    0x0145, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageSize<0x0144, Group::subimg2> },
         {    0x0201, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageData<0x0202, Group::subimg2> },
         {    0x0202, Group::subimg2,   Group::subimg2,   0x014a,    Group::ifd0,      newTiffImageSize<0x0201, Group::subimg2> },
         { Tag::next, Group::subimg2,   Group::ignr,      0x014a,    Group::ifd0,      newTiffDirectory },
@@ -313,6 +319,8 @@ namespace Exiv2 {
         // Subdir subimg3
         {    0x0111, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageData<0x0117, Group::subimg3> },
         {    0x0117, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageSize<0x0111, Group::subimg3> },
+        {    0x0144, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageData<0x0145, Group::subimg3> },
+        {    0x0145, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageSize<0x0144, Group::subimg3> },
         {    0x0201, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageData<0x0202, Group::subimg3> },
         {    0x0202, Group::subimg3,   Group::subimg3,   0x014a,    Group::ifd0,      newTiffImageSize<0x0201, Group::subimg3> },
         { Tag::next, Group::subimg3,   Group::ignr,      0x014a,    Group::ifd0,      newTiffDirectory },
@@ -321,6 +329,8 @@ namespace Exiv2 {
         // Subdir subimg4
         {    0x0111, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageData<0x0117, Group::subimg4> },
         {    0x0117, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageSize<0x0111, Group::subimg4> },
+        {    0x0144, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageData<0x0145, Group::subimg4> },
+        {    0x0145, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageSize<0x0144, Group::subimg4> },
         {    0x0201, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageData<0x0202, Group::subimg4> },
         {    0x0202, Group::subimg4,   Group::subimg4,   0x014a,    Group::ifd0,      newTiffImageSize<0x0201, Group::subimg4> },
         { Tag::next, Group::subimg4,   Group::ignr,      0x014a,    Group::ifd0,      newTiffDirectory },
diff --git a/test/data/tiff-test.out b/test/data/tiff-test.out
index 98ac9a4..6a4d765 100644
--- a/test/data/tiff-test.out
+++ b/test/data/tiff-test.out
@@ -88,7 +88,7 @@ Exif.Image.ResolutionUnit                    0x0128 Short       1  2
 Exif.Photo.DateTimeOriginal                  0x9003 Ascii      18  Yesterday at noon
 File Name = mini9.tif
 File Type = TIFF:II
-File Size = 573
+File Size = 574
 @000000000=0       :  TIFF(II=0x4949) magic=0x002a='*

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list