[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:27 UTC 2017


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

The following commit has been merged in the master branch:
commit 792b272ad7b7e029cdc4c905ae50986c3693457a
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat May 2 01:42:43 2009 +0000

    #628: Write COM segment (JPEG comment) last, after all APPn segments.
---
 src/jpgimage.cpp | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index 9091086..e2c530e 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -586,21 +586,8 @@ namespace Exiv2 {
 
             if (insertPos == count) {
                 byte tmpBuf[64];
-                if (!comment_.empty()) {
-                    // Write COM marker, size of comment, and string
-                    tmpBuf[0] = 0xff;
-                    tmpBuf[1] = com_;
-
-                    if (comment_.length() + 3 > 0xffff) throw Error(37, "JPEG comment");
-                    us2Data(tmpBuf + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
-
-                    if (outIo.write(tmpBuf, 4) != 4) throw Error(21);
-                    if (outIo.write((byte*)comment_.data(), (long)comment_.length())
-                        != (long)comment_.length()) throw Error(21);
-                    if (outIo.putb(0)==EOF) throw Error(21);
-                    if (outIo.error()) throw Error(21);
-                    --search;
-                }
+                // Write Exif data first so that - if there is no app0 - we
+                // create "Exif images" according to the Exif standard.
                 if (exifData_.count() > 0) {
                     Blob blob;
                     ByteOrder bo = byteOrder();
@@ -685,6 +672,21 @@ namespace Exiv2 {
                         --search;
                     }
                 }
+                if (!comment_.empty()) {
+                    // Write COM marker, size of comment, and string
+                    tmpBuf[0] = 0xff;
+                    tmpBuf[1] = com_;
+
+                    if (comment_.length() + 3 > 0xffff) throw Error(37, "JPEG comment");
+                    us2Data(tmpBuf + 2, static_cast<uint16_t>(comment_.length() + 3), bigEndian);
+
+                    if (outIo.write(tmpBuf, 4) != 4) throw Error(21);
+                    if (outIo.write((byte*)comment_.data(), (long)comment_.length())
+                        != (long)comment_.length()) throw Error(21);
+                    if (outIo.putb(0)==EOF) throw Error(21);
+                    if (outIo.error()) throw Error(21);
+                    --search;
+                }
             }
             if (marker == eoi_) {
                 break;

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list