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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:12 UTC 2017


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

The following commit has been merged in the master branch:
commit 2c82879afec6f38276c699f5e060480aa7b3c62e
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon Dec 18 12:44:03 2006 +0000

    Added second attempt to parse an IPTC field into a string value, if parsing the actual type fails. Fixes bug #501.
---
 src/iptc.cpp                |   9 +++++++++
 src/value.cpp               |  24 +++++++++++++-----------
 test/bugfixes-test.sh       |   4 ++++
 test/data/bugfixes-test.out |  26 ++++++++++++++++++++++++++
 test/data/exiv2-bug501.jpg  | Bin 0 -> 12494 bytes
 5 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/src/iptc.cpp b/src/iptc.cpp
index 6502bd8..422e558 100644
--- a/src/iptc.cpp
+++ b/src/iptc.cpp
@@ -183,6 +183,15 @@ namespace Exiv2 {
             IptcKey key(dataSet, record);
             add(key, value.get());
         }
+        else if (1 == rc) {
+            // If the first attempt failed, try with a string value
+            value = Value::create(string);
+            int rc = value->read(data, sizeData, bigEndian);
+            if (0 == rc) {
+                IptcKey key(dataSet, record);
+                add(key, value.get());
+            }
+        }
         return rc;
     }
 
diff --git a/src/value.cpp b/src/value.cpp
index c2df29b..3a08731 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -327,7 +327,7 @@ namespace Exiv2 {
             charsetId = CharsetInfo::charsetIdByName(name);
             if (charsetId == invalidCharsetId) {
 #ifndef SUPPRESS_WARNINGS
-                std::cerr << Error(28, name) << "
";
+                std::cerr << "Warning: " << Error(28, name) << "
";
 #endif
                 return 1;
             }
@@ -391,7 +391,7 @@ namespace Exiv2 {
         // Hard coded to read Iptc style dates
         if (len != 8) {
 #ifndef SUPPRESS_WARNINGS
-            std::cerr << Error(29) << "
";
+            std::cerr << "Warning: " << Error(29) << "
";
 #endif
             return 1;
         }
@@ -402,7 +402,7 @@ namespace Exiv2 {
                              &date_.year, &date_.month, &date_.day);
         if (scanned != 3) {
 #ifndef SUPPRESS_WARNINGS
-            std::cerr << Error(29) << "
";
+            std::cerr << "Warning: " << Error(29) << "
";
 #endif
             return 1;
         }
@@ -414,7 +414,7 @@ namespace Exiv2 {
         // Hard coded to read Iptc style dates
         if (buf.length() < 8) {
 #ifndef SUPPRESS_WARNINGS
-            std::cerr << Error(29) << "
";
+            std::cerr << "Warning: " << Error(29) << "
";
 #endif
             return 1;
         }
@@ -422,7 +422,7 @@ namespace Exiv2 {
                              &date_.year, &date_.month, &date_.day);
         if (scanned != 3) {
 #ifndef SUPPRESS_WARNINGS
-            std::cerr << Error(29) << "
";
+            std::cerr << "Warning: " << Error(29) << "
";
 #endif
             return 1;
         }
@@ -511,11 +511,12 @@ namespace Exiv2 {
         if (len == 11) {
             rc = scanTime6(b, "%2d%2d%2d%1c%2d%2d");
         }
-#ifndef SUPPRESS_WARNINGS
         if (rc) {
-            std::cerr << Error(30) << "
";
-        }
+            rc = 1;
+#ifndef SUPPRESS_WARNINGS
+            std::cerr << "Warning: " << Error(30) << "
";
 #endif
+        }
         return rc;
     }
 
@@ -530,11 +531,12 @@ namespace Exiv2 {
         else {
             rc = scanTime6(buf.c_str(), "%d:%d:%d%1c%d:%d");
         }
-#ifndef SUPPRESS_WARNINGS
         if (rc) {
-            std::cerr << Error(30) << "
";
-        }
+            rc = 1;
+#ifndef SUPPRESS_WARNINGS
+            std::cerr << "Warning: " << Error(30) << "
";
 #endif
+        }
         return rc;
     }
 
diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh
index 05bcfc1..bee83f0 100755
--- a/test/bugfixes-test.sh
+++ b/test/bugfixes-test.sh
@@ -78,6 +78,10 @@ $binpath/exiv2 -v -pv $filename
 $binpath/exiv2 -v -M"del Exif.GPSInfo.GPSLatitude" $filename
 $binpath/exiv2 -v -pv $filename
 
+num=501
+filename=`prep_file $num`
+$binpath/exiv2 -pi $filename
+
 ) > $results 2>&1
 
 if [ x"`which unix2dos.exe`" != x ]; then
diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out
index 3e9451f..e80dd28 100644
--- a/test/data/bugfixes-test.out
+++ b/test/data/bugfixes-test.out
@@ -266,3 +266,29 @@ File 1/1: exiv2-bug498.jpg
 Del Exif.GPSInfo.GPSLatitude
 File 1/1: exiv2-bug498.jpg
 exiv2-bug498.jpg: No Exif data found in the file
+------> Bug 501 <-------
+Warning: Unsupported time format
+Iptc.Application2.RecordVersion              Short       1  2
+Iptc.Application2.Caption                    String     15  Porträtt på Eva
+Iptc.Application2.Writer                     String     10  Elsa Nordh
+Iptc.Application2.Byline                     String     10  Elsa Nordh
+Iptc.Application2.ObjectName                 String      7  Hundbus
+Iptc.Application2.DateCreated                Date        8  2006-10-31
+Iptc.Application2.City                       String      8  Göteborg
+Iptc.Application2.ProvinceState              String     15  Västra Götaland
+Iptc.Application2.CountryName                String      6  Sweden
+Iptc.Application2.Keywords                   String      3  Eva
+Iptc.Application2.Keywords                   String      7  Gallery
+Iptc.Application2.Keywords                   String     21  Framkalla jul06 mamma
+Iptc.Application2.Copyright                  String     19  http://nordharna.se
+Iptc.Application2.ExpirationTime             String      2  SE
+Iptc.Application2.SubLocation                String      9  KÃ¥lltorp
+Iptc.Application2.0x00d1                     String      9  Göteborg
+Iptc.Application2.0x00d2                     String     17  Västra Götaland
+Iptc.Application2.0x00d3                     String      6  416 81
+Iptc.Application2.0x00d4                     String      6  Sweden
+Iptc.Application2.0x00d5                     String     19  +46-(0)736-21 50 74
+Iptc.Application2.0x00d6                     String     17  foto at nordharna.se
+Iptc.Application2.0x00d7                     String     27  http://gallery.nordharna.se
+Iptc.Application2.0x00e3                     String     27  http://gallery.nordharna.se
+Iptc.Application2.0x00f2                     String      1  4
diff --git a/test/data/exiv2-bug501.jpg b/test/data/exiv2-bug501.jpg
new file mode 100644
index 0000000..1e230cc
Binary files /dev/null and b/test/data/exiv2-bug501.jpg differ

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list