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


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

The following commit has been merged in the master branch:
commit 76a3a36e51b6b5e0fc95cda9ac578dc9c61d4421
Author: HumanDynamo <caulier.gilles at gmail.com>
Date:   Thu Jun 18 08:29:22 2009 +0000

    creating JPEG2 blank file from scratch is now supported
---
 src/jp2image.cpp | 36 +++++++++++++++++++++++++++++++++++-
 src/jp2image.hpp |  1 -
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index 625d1a0..1b01934 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -69,6 +69,24 @@ const unsigned char kJp2UuidXmp[]  = "\xbe\x7a\xcf\xcb\x97\xa9\x42\xe8\x9c\x71\x
 // See section B.1.1 (JPEG 2000 Signature box) of JPEG-2000 specification
 const unsigned char Jp2Signature[12] = { 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a };
 
+const unsigned char Jp2Blank[] = { 0x00,0x00,0x00,0x0c,0x6a,0x50,0x20,0x20,0x0d,0x0a,0x87,0x0a,0x00,0x00,0x00,0x14,
+                                   0x66,0x74,0x79,0x70,0x6a,0x70,0x32,0x20,0x00,0x00,0x00,0x00,0x6a,0x70,0x32,0x20,
+                                   0x00,0x00,0x00,0x2d,0x6a,0x70,0x32,0x68,0x00,0x00,0x00,0x16,0x69,0x68,0x64,0x72,
+                                   0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x07,0x07,0x00,0x00,0x00,0x00,
+                                   0x00,0x0f,0x63,0x6f,0x6c,0x72,0x01,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
+                                   0x00,0x6a,0x70,0x32,0x63,0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,
+                                   0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+                                   0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,
+                                   0x01,0x01,0xff,0x64,0x00,0x23,0x00,0x01,0x43,0x72,0x65,0x61,0x74,0x6f,0x72,0x3a,
+                                   0x20,0x4a,0x61,0x73,0x50,0x65,0x72,0x20,0x56,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,
+                                   0x31,0x2e,0x39,0x30,0x30,0x2e,0x31,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,
+                                   0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,
+                                   0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x90,0x00,0x0a,0x00,0x00,
+                                   0x00,0x00,0x00,0x2d,0x00,0x01,0xff,0x5d,0x00,0x14,0x00,0x40,0x40,0x00,0x00,0x00,
+                                   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x93,0xcf,0xb4,
+                                   0x04,0x00,0x80,0x80,0x80,0x80,0x80,0xff,0xd9
+                                 };
+
 //! @cond IGNORE
 struct Jp2BoxHeader
 {
@@ -99,9 +117,25 @@ struct Jp2UuidBox
 namespace Exiv2
 {
 
-    Jp2Image::Jp2Image(BasicIo::AutoPtr io, bool /*create*/)
+    Jp2Image::Jp2Image(BasicIo::AutoPtr io, bool create)
             : Image(ImageType::jp2, mdExif | mdIptc | mdXmp, io)
     {
+        if (create)
+        {
+            if (io_->open() == 0)
+            {
+#ifdef DEBUG
+                std::cerr << "Exiv2::Jp2Image:: Creating PNG image to memory
";
+#endif
+                IoCloser closer(*io_);
+                if (io_->write(Jp2Blank, sizeof(Jp2Blank)) != sizeof(Jp2Blank))
+                {
+#ifdef DEBUG
+                    std::cerr << "Exiv2::Jp2Image:: Failed to create PNG image on memory
";
+#endif
+                }
+            }
+        }
     } // Jp2Image::Jp2Image
 
     void Jp2Image::setComment(const std::string& /*comment*/)
diff --git a/src/jp2image.hpp b/src/jp2image.hpp
index 2610f54..2e96098 100644
--- a/src/jp2image.hpp
+++ b/src/jp2image.hpp
@@ -76,7 +76,6 @@ namespace Exiv2
               method to get a temporary reference.
           @param create Specifies if an existing image should be read (false)
               or if a new file should be created (true).
-              This option is not yet implemented.
          */
         Jp2Image(BasicIo::AutoPtr io, bool create);
         //@}

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list