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


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

The following commit has been merged in the master branch:
commit 5463d4f89d6ba66e79f604778e3a128c13e77e94
Author: Robin Mills <robin at clanmills.com>
Date:   Tue Apr 21 18:17:39 2015 +0000

    #1058.  xml:lang case insensitive.  Working well.  Added regression detector.
---
 src/xmp.cpp                  |  36 ++++++++++++------------------------
 test/bugfixes-test.sh        |  16 ++++++++++++++++
 test/data/bugfixes-test.out  | Bin 141119 -> 141360 bytes
 test/data/xmpparser-test.out |  22 +++++++++++-----------
 4 files changed, 39 insertions(+), 35 deletions(-)

diff --git a/src/xmp.cpp b/src/xmp.cpp
index 7075667..9467452 100644
--- a/src/xmp.cpp
+++ b/src/xmp.cpp
@@ -89,13 +89,11 @@ namespace {
     //! Convert XmpFormatFlags to XMP Toolkit format option bits
     XMP_OptionBits xmpFormatOptionBits(Exiv2::XmpParser::XmpFormatFlags flags);
 
-# ifdef DEBUG
     //! Print information about a parsed XMP node
     void printNode(const std::string& schemaNs,
                    const std::string& propPath,
                    const std::string& propValue,
                    const XMP_OptionBits& opt);
-# endif // DEBUG
 #endif // EXV_HAVE_XMP_TOOLKIT
 
     //! Make an XMP key from a schema namespace and property path
@@ -494,9 +492,7 @@ namespace Exiv2 {
         std::string schemaNs, propPath, propValue;
         XMP_OptionBits opt;
         while (iter.Next(&schemaNs, &propPath, &propValue, &opt)) {
-#ifdef DEBUG
             printNode(schemaNs, propPath, propValue, opt);
-#endif
             if (XMP_PropIsAlias(opt)) {
                 throw Error(47, schemaNs, propPath, propValue);
                 continue;
@@ -521,9 +517,7 @@ namespace Exiv2 {
                 while (count-- > 0) {
                     // Get the text
                     bool haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
-#ifdef DEBUG
                     printNode(schemaNs, propPath, propValue, opt);
-#endif
                     if (   !haveNext
                         || !XMP_PropIsSimple(opt)
                         || !XMP_PropHasLang(opt)) {
@@ -532,9 +526,7 @@ namespace Exiv2 {
                     const std::string text = propValue;
                     // Get the language qualifier
                     haveNext = iter.Next(&schemaNs, &propPath, &propValue, &opt);
-#ifdef DEBUG
                     printNode(schemaNs, propPath, propValue, opt);
-#endif
                     if (   !haveNext
                         || !XMP_PropIsSimple(opt)
                         || !XMP_PropIsQualifier(opt)
@@ -571,9 +563,7 @@ namespace Exiv2 {
                     XMP_Index count = meta.CountArrayItems(schemaNs.c_str(), propPath.c_str());
                     while (count-- > 0) {
                         iter.Next(&schemaNs, &propPath, &propValue, &opt);
-#ifdef DEBUG
                         printNode(schemaNs, propPath, propValue, opt);
-#endif
                         val->read(propValue);
                     }
                     xmpData.add(*key.get(), val.get());
@@ -669,12 +659,12 @@ namespace Exiv2 {
                     ; k != la->value_.end()
                     ; ++k
                 ) {
-#ifdef DEBUG
-                    printNode(ns, i->tagName(), k->second, 0);
-#endif
-                    meta.AppendArrayItem(ns.c_str(), i->tagName().c_str(), kXMP_PropArrayIsAlternate, k->second.c_str());
-                    const std::string item = i->tagName() + "[" + toString(idx++) + "]";
-                    meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", k->first.c_str());
+                	if ( k->second.size() ) { // remove lang specs with no value
+                    	printNode(ns, i->tagName(), k->second, 0);
+                    	meta.AppendArrayItem(ns.c_str(), i->tagName().c_str(), kXMP_PropArrayIsAlternate, k->second.c_str());
+                    	const std::string item = i->tagName() + "[" + toString(idx++) + "]";
+                    	meta.SetQualifier(ns.c_str(), item.c_str(), kXMP_NS_XML, "lang", k->first.c_str());
+                    }
                 }
                 continue;
             }
@@ -687,30 +677,22 @@ namespace Exiv2 {
             if (   i->typeId() == xmpBag
                 || i->typeId() == xmpSeq
                 || i->typeId() == xmpAlt) {
-#ifdef DEBUG
                 printNode(ns, i->tagName(), "", options);
-#endif
                 meta.SetProperty(ns.c_str(), i->tagName().c_str(), 0, options);
                 for (int idx = 0; idx < i->count(); ++idx) {
                     const std::string item = i->tagName() + "[" + toString(idx + 1) + "]";
-#ifdef DEBUG
                     printNode(ns, item, i->toString(idx), 0);
-#endif
                     meta.SetProperty(ns.c_str(), item.c_str(), i->toString(idx).c_str());
                 }
                 continue;
             }
             if (i->typeId() == xmpText) {
                 if (i->count() == 0) {
-#ifdef DEBUG
                     printNode(ns, i->tagName(), "", options);
-#endif
                     meta.SetProperty(ns.c_str(), i->tagName().c_str(), 0, options);
                 }
                 else {
-#ifdef DEBUG
                     printNode(ns, i->tagName(), i->toString(0), options);
-#endif
                     meta.SetProperty(ns.c_str(), i->tagName().c_str(), i->toString(0).c_str(), options);
                 }
                 continue;
@@ -866,6 +848,12 @@ namespace {
         }
         std::cout << std::endl;
     }
+#else
+    void printNode(const std::string& ,
+                   const std::string& ,
+                   const std::string& ,
+                   const XMP_OptionBits& )
+    {}
 #endif // DEBUG
 #endif // EXV_HAVE_XMP_TOOLKIT
 
diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh
index b5e94e7..b0c538b 100755
--- a/test/bugfixes-test.sh
+++ b/test/bugfixes-test.sh
@@ -336,6 +336,22 @@ source ./functions.source
 	runTest exiv2 -PE -K ImageWidth            $filename
 	runTest exiv2 -PE -K Exif.Image.ImageWidth $filename
 
+	num=1058
+	filename=exiv2-bug$num.jpg
+	printf "$num " >&3
+	echo '------>' Bug $num '<-------' >&2
+	copyTestFile exiv2-empty.jpg $filename
+	# Add titles in 2 languages and one default
+	runTest exiv2 -M'set Xmp.dc.title lang="de-DE" GERMAN'  $filename
+	runTest exiv2 -M'set Xmp.dc.title lang="en-GB" BRITISH' $filename
+	runTest exiv2 -M'set Xmp.dc.title Everybody else'       $filename
+	runTest exiv2 -px                                       $filename
+	# Remove languages, test case for the language
+	runTest exiv2 -M'set Xmp.dc.title lang="DE-de" german'  $filename
+	runTest exiv2 -M'set Xmp.dc.title lang="EN-gb"'         $filename
+	runTest exiv2 -M'set Xmp.dc.title'                      $filename
+	runTest exiv2 -px                                       $filename
+
 ) 3>&1 > $results 2>&1
 
 printf "
"
diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out
index 1db2634..354e038 100644
Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ
diff --git a/test/data/xmpparser-test.out b/test/data/xmpparser-test.out
index 2b91b5c..088c2fd 100644
--- a/test/data/xmpparser-test.out
+++ b/test/data/xmpparser-test.out
@@ -1,6 +1,6 @@
 -----> Decoding XMP data read from BlueSquare.xmp <-----
 Xmp.dc.format                                XmpText    10  image/jpeg
-Xmp.dc.title                                 LangAlt     3  lang="x-default" Blue Square Test File - .jpg, lang="de-CH" Blaues Quadrat Test Datei - .jpg, lang="en-US" Blue Square Test File - .jpg
+Xmp.dc.title                                 LangAlt     3  lang="x-default" Blue Square Test File - .jpg, lang="en-US" Blue Square Test File - .jpg, lang="de-CH" Blaues Quadrat Test Datei - .jpg
 Xmp.dc.description                           LangAlt     1  lang="x-default" XMPFiles BlueSquare test file, created in Photoshop CS2, saved as .psd, .jpg, and .tif.
 Xmp.dc.subject                               XmpBag      5  XMP, Blue Square, test file, Photoshop, .jpg
 Xmp.xmp.CreatorTool                          XmpText    29  Adobe Photoshop CS2 Macintosh
@@ -32,10 +32,10 @@ Xmp.exif.NativeDigest                        XmpText   414  36864,40960,40961,37
 < <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="3.1.2-113">
 ---
 > <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
-34a35
->      <rdf:li xml:lang="de-CH">Blaues Quadrat Test Datei - .jpg</rdf:li>
-37d37
-<      <rdf:li xml:lang="de-CH">Blaues Quadrat Test Datei - .jpg</rdf:li>
+35d34
+<      <rdf:li xml:lang="en-US">Blue Square Test File - .jpg</rdf:li>
+36a36
+>      <rdf:li xml:lang="en-US">Blue Square Test File - .jpg</rdf:li>
 -----> Decoding XMP data read from StaffPhotographer-Example.xmp <-----
 Xmp.iptc.IntellectualGenre                   XmpText     7  Profile
 Xmp.iptc.Location                            XmpText    17  Moore family farm
@@ -147,7 +147,7 @@ Xmp.ns1.SimpleProp1                          XmpText    13  Simple1 value
 Xmp.ns1.SimpleProp2                          XmpText    13  Simple2 value
 Xmp.ns1.SimpleProp2/?xml:lang                XmpText     9  x-default
 Xmp.ns1.ArrayProp1                           XmpBag      2  Item1.1 value, Item1.2 value
-Xmp.ns1.ArrayProp2                           LangAlt     2  lang="x-one" Item2.1 value, lang="x-two" Item2.2 value
+Xmp.ns1.ArrayProp2                           LangAlt     2  lang="x-two" Item2.2 value, lang="x-one" Item2.1 value
 Xmp.ns1.StructProp                           XmpText     0  type="Struct"
 Xmp.ns1.StructProp/ns2:Field1                XmpText    12  Field1 value
 Xmp.ns1.StructProp/ns2:Field2                XmpText    12  Field2 value
@@ -229,8 +229,8 @@ Xmp.ns1.NestedStructProp/ns2:Outer/ns2:Middle/ns2:Inner/ns2:Field2 XmpText    12
 >    </ns1:ArrayProp1>
 >    <ns1:ArrayProp2>
 >     <rdf:Alt>
->      <rdf:li xml:lang="x-one">Item2.1 value</rdf:li>
 >      <rdf:li xml:lang="x-two">Item2.2 value</rdf:li>
+>      <rdf:li xml:lang="x-one">Item2.1 value</rdf:li>
 >     </rdf:Alt>
 >    </ns1:ArrayProp2>
 >    <ns1:StructProp
@@ -281,7 +281,7 @@ Xmp.ns1.NestedStructProp/ns2:Outer/ns2:Middle/ns2:Inner/ns2:Field2 XmpText    12
 \ No newline at end of file
 Xmp.dc.source                                XmpText    13  xmpsample.cpp
 Xmp.dc.subject                               XmpBag      2  Palmtree, Rubbertree
-Xmp.dc.title                                 LangAlt     2  lang="de-DE" Sonnenuntergang am Strand, lang="en-US" Sunset on the beach
+Xmp.dc.title                                 LangAlt     2  lang="en-US" Sunset on the beach, lang="de-DE" Sonnenuntergang am Strand
 Xmp.dc.one                                   XmpText     2  -1
 Xmp.dc.two                                   XmpText     6  3.1415
 Xmp.dc.three                                 XmpText     3  5/7
@@ -338,8 +338,8 @@ Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork XmpText    20  http://www.exi
    </dc:subject>
    <dc:title>
     <rdf:Alt>
-     <rdf:li xml:lang="de-DE">Sonnenuntergang am Strand</rdf:li>
      <rdf:li xml:lang="en-US">Sunset on the beach</rdf:li>
+     <rdf:li xml:lang="de-DE">Sonnenuntergang am Strand</rdf:li>
     </rdf:Alt>
    </dc:title>
    <dc:creator>
@@ -354,8 +354,8 @@ Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork XmpText    20  http://www.exi
    </dc:creator>
    <dc:description>
     <rdf:Alt>
-     <rdf:li xml:lang="de-DE">Hallo, Welt</rdf:li>
      <rdf:li xml:lang="x-default">Hello, World</rdf:li>
+     <rdf:li xml:lang="de-DE">Hallo, Welt</rdf:li>
     </rdf:Alt>
    </dc:description>
    <dc:publisher>
@@ -368,8 +368,8 @@ Xmp.iptc.CreatorContactInfo/Iptc4xmpCore:CiUrlWork XmpText    20  http://www.exi
    </dc:publisher>
    <tiff:ImageDescription>
     <rdf:Alt>
-     <rdf:li xml:lang="de-DE">TIFF Bildbeschreibung</rdf:li>
      <rdf:li xml:lang="x-default">TIFF image description</rdf:li>
+     <rdf:li xml:lang="de-DE">TIFF Bildbeschreibung</rdf:li>
     </rdf:Alt>
    </tiff:ImageDescription>
    <xmpDM:videoFrameSize

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list