Hello community,

here is the log from the commit of package kimageformats for openSUSE:Factory 
checked in at 2019-10-14 13:36:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kimageformats (Old)
 and      /work/SRC/openSUSE:Factory/.kimageformats.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kimageformats"

Mon Oct 14 13:36:40 2019 rev:73 rq:738035 version:5.63.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kimageformats/kimageformats.changes      
2019-09-23 12:23:59.741742124 +0200
+++ /work/SRC/openSUSE:Factory/.kimageformats.new.2352/kimageformats.changes    
2019-10-14 13:36:43.226145198 +0200
@@ -1,0 +2,13 @@
+Sun Oct  6 13:26:39 UTC 2019 - Christophe Giboudeaux <[email protected]>
+
+- Update to 5.63.0
+  * New feature release
+  * For more details please see:
+  * https://www.kde.org/announcements/kde-frameworks-5.63.0.php
+- Changes since 5.62.0:
+  * Add files for testing bug411327
+  * xcf: Fix regression when reading files with "unsupported" properties 
(kde#411327)
+  * xcf: Properly read image resolution
+  * Port HDR (Radiance RGBE) image loader to Qt5
+
+-------------------------------------------------------------------

Old:
----
  kimageformats-5.62.0.tar.xz
  kimageformats-5.62.0.tar.xz.sig

New:
----
  kimageformats-5.63.0.tar.xz
  kimageformats-5.63.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kimageformats.spec ++++++
--- /var/tmp/diff_new_pack.wqbX2q/_old  2019-10-14 13:36:43.778143760 +0200
+++ /var/tmp/diff_new_pack.wqbX2q/_new  2019-10-14 13:36:43.778143760 +0200
@@ -16,7 +16,7 @@
 #
 
 
-%define _tar_path 5.62
+%define _tar_path 5.63
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
@@ -24,7 +24,7 @@
 # Only needed for the package signature condition
 %bcond_without lang
 Name:           kimageformats
-Version:        5.62.0
+Version:        5.63.0
 Release:        0
 Summary:        Image format plugins for Qt
 License:        LGPL-2.1-or-later
@@ -43,12 +43,12 @@
 BuildRequires:  openexr
 BuildRequires:  openexr-devel
 BuildRequires:  cmake(KF5Archive) >= %{_kf5_bugfix_version}
-BuildRequires:  cmake(Qt5Gui) >= 5.6.0
-BuildRequires:  cmake(Qt5PrintSupport) >= 5.6.0
-BuildRequires:  cmake(Qt5Test) >= 5.6.0
+BuildRequires:  cmake(Qt5Gui) >= 5.11.0
+BuildRequires:  cmake(Qt5PrintSupport) >= 5.11.0
+BuildRequires:  cmake(Qt5Test) >= 5.11.0
 %requires_ge    libQt5Gui5
 %requires_ge    libQt5PrintSupport5
-Recommends:     libqt5-qtimageformats >= 5.6.0
+Recommends:     libqt5-qtimageformats >= 5.11.0
 Suggests:       %{name}-eps
 
 %description
@@ -83,6 +83,7 @@
 %license COPYING*
 %dir %{_kf5_plugindir}/imageformats
 %{_kf5_plugindir}/imageformats/kimg_exr.so
+%{_kf5_plugindir}/imageformats/kimg_hdr.so
 %{_kf5_plugindir}/imageformats/kimg_kra.so
 %{_kf5_plugindir}/imageformats/kimg_ora.so
 %{_kf5_plugindir}/imageformats/kimg_pcx.so
@@ -95,6 +96,7 @@
 %dir %{_kf5_servicesdir}/qimageioplugins
 %{_kf5_servicesdir}/qimageioplugins/dds.desktop
 %{_kf5_servicesdir}/qimageioplugins/exr.desktop
+%{_kf5_servicesdir}/qimageioplugins/hdr.desktop
 %{_kf5_servicesdir}/qimageioplugins/jp2.desktop
 %{_kf5_servicesdir}/qimageioplugins/kra.desktop
 %{_kf5_servicesdir}/qimageioplugins/ora.desktop


++++++ kimageformats-5.62.0.tar.xz -> kimageformats-5.63.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/CMakeLists.txt 
new/kimageformats-5.63.0/CMakeLists.txt
--- old/kimageformats-5.62.0/CMakeLists.txt     2019-09-07 14:35:26.000000000 
+0200
+++ new/kimageformats-5.63.0/CMakeLists.txt     2019-10-06 11:35:52.000000000 
+0200
@@ -3,7 +3,7 @@
 project(KImageFormats)
 
 include(FeatureSummary)
-find_package(ECM 5.62.0  NO_MODULE)
+find_package(ECM 5.63.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/autotests/CMakeLists.txt 
new/kimageformats-5.63.0/autotests/CMakeLists.txt
--- old/kimageformats-5.62.0/autotests/CMakeLists.txt   2019-09-07 
14:35:26.000000000 +0200
+++ new/kimageformats-5.63.0/autotests/CMakeLists.txt   2019-10-06 
11:35:52.000000000 +0200
@@ -55,6 +55,7 @@
 # Loads each <format> image in read/<format>/, and compares the
 # result against the data read from the corresponding png file
 kimageformats_read_tests(
+    hdr
     pcx
     psd
     ras
Binary files old/kimageformats-5.62.0/autotests/read/hdr/rgb.hdr and 
new/kimageformats-5.63.0/autotests/read/hdr/rgb.hdr differ
Binary files old/kimageformats-5.62.0/autotests/read/hdr/rgb.png and 
new/kimageformats-5.63.0/autotests/read/hdr/rgb.png differ
Binary files old/kimageformats-5.62.0/autotests/read/xcf/bug411327.png and 
new/kimageformats-5.63.0/autotests/read/xcf/bug411327.png differ
Binary files old/kimageformats-5.62.0/autotests/read/xcf/bug411327.xcf and 
new/kimageformats-5.63.0/autotests/read/xcf/bug411327.xcf differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/src/imageformats/CMakeLists.txt 
new/kimageformats-5.63.0/src/imageformats/CMakeLists.txt
--- old/kimageformats-5.62.0/src/imageformats/CMakeLists.txt    2019-09-07 
14:35:26.000000000 +0200
+++ new/kimageformats-5.63.0/src/imageformats/CMakeLists.txt    2019-10-06 
11:35:52.000000000 +0200
@@ -53,6 +53,11 @@
 
 ##################################
 
+kimageformats_add_plugin(kimg_hdr JSON "hdr.json" SOURCES hdr.cpp)
+install(FILES hdr.desktop DESTINATION 
${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
+
+##################################
+
 kimageformats_add_plugin(kimg_pcx JSON "pcx.json" SOURCES pcx.cpp)
 install(FILES pcx.desktop DESTINATION 
${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/src/imageformats/hdr.cpp 
new/kimageformats-5.63.0/src/imageformats/hdr.cpp
--- old/kimageformats-5.62.0/src/imageformats/hdr.cpp   2019-09-07 
14:35:26.000000000 +0200
+++ new/kimageformats-5.63.0/src/imageformats/hdr.cpp   2019-10-06 
11:35:52.000000000 +0200
@@ -15,7 +15,7 @@
 
 #include <QDebug>
 
-typedef Q_UINT8 uchar;
+typedef unsigned char uchar;
 
 namespace   // Private.
 {
@@ -93,19 +93,22 @@
     uchar val, code;
 
     // Create dst image.
-    if (!img.create(width, height, 32)) {
+    img = QImage(width, height, QImage::Format_RGB32);
+    if (img.isNull()) {
         return false;
     }
 
-    QMemArray<uchar> image(width * 4);
+    QByteArray lineArray;
+    lineArray.resize(4 * width);
+    uchar *image = (uchar *) lineArray.data();
 
     for (int cline = 0; cline < height; cline++) {
         QRgb *scanline = (QRgb *) img.scanLine(cline);
 
         // determine scanline type
         if ((width < MINELEN) || (MAXELEN < width)) {
-            Read_Old_Line(image.data(), width, s);
-            RGBE_To_QRgbLine(image.data(), scanline, width);
+            Read_Old_Line(image, width, s);
+            RGBE_To_QRgbLine(image, scanline, width);
             continue;
         }
 
@@ -116,9 +119,9 @@
         }
 
         if (val != 2) {
-            s.device()->at(s.device()->at() - 1);
-            Read_Old_Line(image.data(), width, s);
-            RGBE_To_QRgbLine(image.data(), scanline, width);
+            s.device()->ungetChar(val);
+            Read_Old_Line(image, width, s);
+            RGBE_To_QRgbLine(image, scanline, width);
             continue;
         }
 
@@ -132,8 +135,8 @@
 
         if ((image[1] != 2) || (image[2] & 128)) {
             image[0] = 2;
-            Read_Old_Line(image.data() + 4, width - 1, s);
-            RGBE_To_QRgbLine(image.data(), scanline, width);
+            Read_Old_Line(image + 4, width - 1, s);
+            RGBE_To_QRgbLine(image, scanline, width);
             continue;
         }
 
@@ -168,7 +171,7 @@
             }
         }
 
-        RGBE_To_QRgbLine(image.data(), scanline, width);
+        RGBE_To_QRgbLine(image, scanline, width);
     }
 
     return true;
@@ -176,7 +179,7 @@
 
 } // namespace
 
-Q_DECL_EXPORT void kimgio_hdr_read(QImageIO *io)
+bool HDRHandler::read(QImage *outImage)
 {
     int len;
     char line[MAXLINE];
@@ -185,7 +188,7 @@
 
     // Parse header
     do {
-        len = io->ioDevice()->readLine(line, MAXLINE);
+        len = device()->readLine(line, MAXLINE);
 
         /*if (strcmp(line, "#?RADIANCE\n") == 0 || strcmp(line, "#?RGBE\n") == 
0)
         {
@@ -199,12 +202,10 @@
 
     if (/*!validHeader ||*/ !validFormat) {
         // qDebug() << "Unknown HDR format.";
-        io->setImage(0);
-        io->setStatus(-1);
-        return;
+        return false;
     }
 
-    io->ioDevice()->readLine(line, MAXLINE);
+    device()->readLine(line, MAXLINE);
 
     char s1[3], s2[3];
     int width, height;
@@ -212,27 +213,67 @@
         //if( sscanf(line, "-Y %d +X %d", &height, &width) < 2 )
     {
         // qDebug() << "Invalid HDR file.";
-        io->setImage(0);
-        io->setStatus(-1);
-        return;
+        return false;
     }
 
-    QDataStream s(io->ioDevice());
+    QDataStream s(device());
 
     QImage img;
     if (!LoadHDR(s, width, height, img)) {
         // qDebug() << "Error loading HDR file.";
-        io->setImage(0);
-        io->setStatus(-1);
-        return;
+        return false;
+    }
+
+    *outImage = img;
+    return true;
+}
+
+HDRHandler::HDRHandler()
+{
+}
+
+bool HDRHandler::canRead() const
+{
+    if (canRead(device())) {
+        setFormat("hdr");
+        return true;
+    }
+    return false;
+}
+
+bool HDRHandler::canRead(QIODevice *device)
+{
+    if (!device) {
+        qWarning("HDRHandler::canRead() called with no device");
+        return false;
     }
 
-    io->setImage(img);
-    io->setStatus(0);
+    return device->peek(11) == "#?RADIANCE\n" || device->peek(7) == "#?RGBE\n";
 }
 
-Q_DECL_EXPORT void kimgio_hdr_write(QImageIO *)
+QImageIOPlugin::Capabilities HDRPlugin::capabilities(QIODevice *device, const 
QByteArray &format) const
 {
-    // intentionally not implemented (since writing low dynamic range data to 
a HDR file is nonsense.)
+    if (format == "hdr") {
+        return Capabilities(CanRead);
+    }
+    if (!format.isEmpty()) {
+        return {};
+    }
+    if (!device->isOpen()) {
+        return {};
+    }
+
+    Capabilities cap;
+    if (device->isReadable() && HDRHandler::canRead(device)) {
+        cap |= CanRead;
+    }
+    return cap;
 }
 
+QImageIOHandler *HDRPlugin::create(QIODevice *device, const QByteArray 
&format) const
+{
+    QImageIOHandler *handler = new HDRHandler;
+    handler->setDevice(device);
+    handler->setFormat(format);
+    return handler;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/src/imageformats/hdr.json 
new/kimageformats-5.63.0/src/imageformats/hdr.json
--- old/kimageformats-5.62.0/src/imageformats/hdr.json  1970-01-01 
01:00:00.000000000 +0100
+++ new/kimageformats-5.63.0/src/imageformats/hdr.json  2019-10-06 
11:35:52.000000000 +0200
@@ -0,0 +1,4 @@
+{
+    "Keys": [ "hdr" ],
+    "MimeTypes": [ "image/x-hdr", "image/vnd.radiance" ]
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/src/imageformats/hdr_p.h 
new/kimageformats-5.63.0/src/imageformats/hdr_p.h
--- old/kimageformats-5.62.0/src/imageformats/hdr_p.h   2019-09-07 
14:35:26.000000000 +0200
+++ new/kimageformats-5.63.0/src/imageformats/hdr_p.h   2019-10-06 
11:35:52.000000000 +0200
@@ -10,12 +10,27 @@
 #ifndef KIMG_HDR_P_H
 #define KIMG_HDR_P_H
 
-class QImageIO;
+#include <QImageIOPlugin>
 
-extern "C" {
-    void kimgio_hdr_read(QImageIO *);
-    void kimgio_hdr_write(QImageIO *);
-}
+class HDRHandler : public QImageIOHandler
+{
+public:
+    HDRHandler();
 
-#endif
+    bool canRead() const override;
+    bool read(QImage *outImage) override;
 
+    static bool canRead(QIODevice *device);
+};
+
+class HDRPlugin : public QImageIOPlugin
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" 
FILE "hdr.json")
+
+public:
+    Capabilities capabilities(QIODevice *device, const QByteArray &format) 
const override;
+    QImageIOHandler *create(QIODevice *device, const QByteArray &format = 
QByteArray()) const override;
+};
+
+#endif // KIMG_HDR_P_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.62.0/src/imageformats/xcf.cpp 
new/kimageformats-5.63.0/src/imageformats/xcf.cpp
--- old/kimageformats-5.62.0/src/imageformats/xcf.cpp   2019-09-07 
14:35:26.000000000 +0200
+++ new/kimageformats-5.63.0/src/imageformats/xcf.cpp   2019-10-06 
11:35:52.000000000 +0200
@@ -414,6 +414,7 @@
             break;
 
         case PROP_RESOLUTION:
+            property.setFloatingPointPrecision(QDataStream::SinglePrecision);
             property >> xcf_image.x_resolution >> xcf_image.y_resolution;
             break;
 
@@ -484,9 +485,15 @@
  * \return true if there were no IO errors.  */
 bool XCFImageFormat::loadProperty(QDataStream &xcf_io, PropType &type, 
QByteArray &bytes, quint32 &rawType)
 {
+    quint32 size;
+
     xcf_io >> rawType;
     if (rawType >= MAX_SUPPORTED_PROPTYPE) {
         type = MAX_SUPPORTED_PROPTYPE;
+        // we don't support the property, but we still need to read from the 
device, assume it's like all the
+        // non custom properties that is data_length + data
+        xcf_io >> size;
+        xcf_io.skipRawData(size);
         // return true because we don't really want to totally fail on an 
unsupported property since it may not be fatal
         return true;
     }
@@ -494,7 +501,6 @@
     type = PropType(rawType);
 
     char *data = nullptr;
-    quint32 size;
 
     // The colormap property size is not the correct number of bytes:
     // The GIMP source xcf.c has size = 4 + ncolors, but it should be


Reply via email to