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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:40:28 UTC 2017


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

The following commit has been merged in the master branch:
commit 05e8255c78045d9ec4f82ec9767c570607f4836d
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat May 9 04:00:43 2009 +0000

    #628: Improved version: insert comments just before SOFn. Updated test cases accordingly.
---
 src/jpgimage.cpp           |  35 +++++++++++++++++++++++++++++++++--
 test/data/smiley1.jpg.c1gd | Bin 2969 -> 2969 bytes
 test/data/smiley1.jpg.c2gd | Bin 2969 -> 2969 bytes
 test/data/smiley1.jpg.c3gd | Bin 11165 -> 11165 bytes
 test/data/smiley1.jpg.i1gd | Bin 2969 -> 2969 bytes
 test/data/smiley1.jpg.i2gd | Bin 2969 -> 2969 bytes
 test/data/smiley1.jpg.i3gd | Bin 2871 -> 2871 bytes
 test/data/smiley2.jpg.c1gd | Bin 3309 -> 3309 bytes
 test/data/smiley2.jpg.c2gd | Bin 3309 -> 3309 bytes
 test/data/smiley2.jpg.c3gd | Bin 11511 -> 11511 bytes
 test/data/smiley2.jpg.i1gd | Bin 11609 -> 11609 bytes
 test/data/smiley2.jpg.i2gd | Bin 11609 -> 11609 bytes
 test/data/smiley2.jpg.i3gd | Bin 11511 -> 11511 bytes
 test/data/table.jpg.c1gd   | Bin 568 -> 568 bytes
 test/data/table.jpg.c2gd   | Bin 568 -> 568 bytes
 test/data/table.jpg.c3gd   | Bin 8764 -> 8764 bytes
 test/data/table.jpg.i1gd   | Bin 568 -> 568 bytes
 test/data/table.jpg.i2gd   | Bin 568 -> 568 bytes
 test/data/table.jpg.i3gd   | Bin 470 -> 470 bytes
 19 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index e2c530e..6a95e41 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -486,6 +486,7 @@ namespace Exiv2 {
         int count = 0;
         int search = 0;
         int insertPos = 0;
+        int comPos = 0;
         int skipApp1Exif = -1;
         int skipApp1Xmp = -1;
         int skipApp13Ps3 = -1;
@@ -503,7 +504,7 @@ namespace Exiv2 {
         // First find segments of interest. Normally app0 is first and we want
         // to insert after it. But if app0 comes after com, app1 and app13 then
         // don't bother.
-        while (marker != sos_ && marker != eoi_ && search < 4) {
+        while (marker != sos_ && marker != eoi_ && search < 5) {
             // Read size and signature (ok if this hits EOF)
             bufRead = io_->read(buf.pData_, bufMinSize);
             if (io_->error()) throw Error(20);
@@ -556,11 +557,37 @@ namespace Exiv2 {
                 if (size < 2) throw Error(22);
                 if (io_->seek(size-bufRead, BasicIo::cur)) throw Error(22);
             }
+            // As in jpeg-6b/wrjpgcom.c:
+            // We will insert the new comment marker just before SOFn.
+            // This (a) causes the new comment to appear after, rather than before,
+            // existing comments; and (b) ensures that comments come after any JFIF
+            // or JFXX markers, as required by the JFIF specification.
+            if (   comPos == 0
+                && (   marker == sof0_
+                    || marker == sof1_
+                    || marker == sof2_
+                    || marker == sof3_
+                    || marker == sof5_
+                    || marker == sof6_
+                    || marker == sof7_
+                    || marker == sof9_
+                    || marker == sof10_
+                    || marker == sof11_
+                    || marker == sof13_
+                    || marker == sof14_
+                    || marker == sof15_)) {
+                comPos = count;
+                ++search;
+            }
             marker = advanceToMarker();
             if (marker < 0) throw Error(22);
             ++count;
         }
-
+        if (comPos == 0) {
+            if (marker == eoi_) comPos = count;
+            else comPos = insertPos;
+            ++search;
+        }
         if (exifData_.count() > 0) ++search;
         if (writeXmpFromPacket() == false && xmpData_.count() > 0) ++search;
         if (writeXmpFromPacket() == true && xmpPacket_.size() > 0) ++search;
@@ -672,7 +699,10 @@ namespace Exiv2 {
                         --search;
                     }
                 }
+            }
+            if (comPos == count) {
                 if (!comment_.empty()) {
+                    byte tmpBuf[4];
                     // Write COM marker, size of comment, and string
                     tmpBuf[0] = 0xff;
                     tmpBuf[1] = com_;
@@ -687,6 +717,7 @@ namespace Exiv2 {
                     if (outIo.error()) throw Error(21);
                     --search;
                 }
+                --search;
             }
             if (marker == eoi_) {
                 break;
diff --git a/test/data/smiley1.jpg.c1gd b/test/data/smiley1.jpg.c1gd
index 79b0df6..4aa4394 100644
Binary files a/test/data/smiley1.jpg.c1gd and b/test/data/smiley1.jpg.c1gd differ
diff --git a/test/data/smiley1.jpg.c2gd b/test/data/smiley1.jpg.c2gd
index c7526ba..e95d116 100644
Binary files a/test/data/smiley1.jpg.c2gd and b/test/data/smiley1.jpg.c2gd differ
diff --git a/test/data/smiley1.jpg.c3gd b/test/data/smiley1.jpg.c3gd
index f3c2429..f9f607b 100644
Binary files a/test/data/smiley1.jpg.c3gd and b/test/data/smiley1.jpg.c3gd differ
diff --git a/test/data/smiley1.jpg.i1gd b/test/data/smiley1.jpg.i1gd
index 79b0df6..4aa4394 100644
Binary files a/test/data/smiley1.jpg.i1gd and b/test/data/smiley1.jpg.i1gd differ
diff --git a/test/data/smiley1.jpg.i2gd b/test/data/smiley1.jpg.i2gd
index c7526ba..e95d116 100644
Binary files a/test/data/smiley1.jpg.i2gd and b/test/data/smiley1.jpg.i2gd differ
diff --git a/test/data/smiley1.jpg.i3gd b/test/data/smiley1.jpg.i3gd
index 5001325..1692792 100644
Binary files a/test/data/smiley1.jpg.i3gd and b/test/data/smiley1.jpg.i3gd differ
diff --git a/test/data/smiley2.jpg.c1gd b/test/data/smiley2.jpg.c1gd
index 490236c..2ead6e1 100644
Binary files a/test/data/smiley2.jpg.c1gd and b/test/data/smiley2.jpg.c1gd differ
diff --git a/test/data/smiley2.jpg.c2gd b/test/data/smiley2.jpg.c2gd
index 66c08f5..fb8c611 100644
Binary files a/test/data/smiley2.jpg.c2gd and b/test/data/smiley2.jpg.c2gd differ
diff --git a/test/data/smiley2.jpg.c3gd b/test/data/smiley2.jpg.c3gd
index fc83db4..84fa5fa 100644
Binary files a/test/data/smiley2.jpg.c3gd and b/test/data/smiley2.jpg.c3gd differ
diff --git a/test/data/smiley2.jpg.i1gd b/test/data/smiley2.jpg.i1gd
index dcff898..7d1b6e1 100644
Binary files a/test/data/smiley2.jpg.i1gd and b/test/data/smiley2.jpg.i1gd differ
diff --git a/test/data/smiley2.jpg.i2gd b/test/data/smiley2.jpg.i2gd
index 4aab020..729ffa7 100644
Binary files a/test/data/smiley2.jpg.i2gd and b/test/data/smiley2.jpg.i2gd differ
diff --git a/test/data/smiley2.jpg.i3gd b/test/data/smiley2.jpg.i3gd
index fc83db4..84fa5fa 100644
Binary files a/test/data/smiley2.jpg.i3gd and b/test/data/smiley2.jpg.i3gd differ
diff --git a/test/data/table.jpg.c1gd b/test/data/table.jpg.c1gd
index 718515b..c0f8bbb 100644
Binary files a/test/data/table.jpg.c1gd and b/test/data/table.jpg.c1gd differ
diff --git a/test/data/table.jpg.c2gd b/test/data/table.jpg.c2gd
index 3d9332f..5597011 100644
Binary files a/test/data/table.jpg.c2gd and b/test/data/table.jpg.c2gd differ
diff --git a/test/data/table.jpg.c3gd b/test/data/table.jpg.c3gd
index 765579b..0696dd8 100644
Binary files a/test/data/table.jpg.c3gd and b/test/data/table.jpg.c3gd differ
diff --git a/test/data/table.jpg.i1gd b/test/data/table.jpg.i1gd
index 718515b..c0f8bbb 100644
Binary files a/test/data/table.jpg.i1gd and b/test/data/table.jpg.i1gd differ
diff --git a/test/data/table.jpg.i2gd b/test/data/table.jpg.i2gd
index 3d9332f..5597011 100644
Binary files a/test/data/table.jpg.i2gd and b/test/data/table.jpg.i2gd differ
diff --git a/test/data/table.jpg.i3gd b/test/data/table.jpg.i3gd
index e39baf5..b5ce973 100644
Binary files a/test/data/table.jpg.i3gd and b/test/data/table.jpg.i3gd differ

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list