Hello community,

here is the log from the commit of package kimageformats for openSUSE:Factory 
checked in at 2020-11-19 11:51:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kimageformats (Old)
 and      /work/SRC/openSUSE:Factory/.kimageformats.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kimageformats"

Thu Nov 19 11:51:04 2020 rev:86 rq:848558 version:5.76.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kimageformats/kimageformats.changes      
2020-10-12 13:56:47.802153106 +0200
+++ /work/SRC/openSUSE:Factory/.kimageformats.new.5913/kimageformats.changes    
2020-11-23 10:32:27.849491094 +0100
@@ -1,0 +2,13 @@
+Sat Nov  7 21:34:52 UTC 2020 - Christophe Giboudeaux <[email protected]>
+
+- Update to 5.76.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/kde-frameworks-5.76.0
+- Changes since 5.75.0:
+  * Add test case for RLE compressed 16 bpc PSD files.
+  * Add support for RLE-compressed, 16 bits per channel PSD files.
+  * Return unsupported when reading 16bit RLE compressed PSD files
+  * feat: add psd color depth == 16 format support
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ kimageformats.spec ++++++
--- /var/tmp/diff_new_pack.IG6M4S/_old  2020-11-23 10:32:28.441491743 +0100
+++ /var/tmp/diff_new_pack.IG6M4S/_new  2020-11-23 10:32:28.445491747 +0100
@@ -16,7 +16,7 @@
 #
 
 
-%define _tar_path 5.75
+%define _tar_path 5.76
 # 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.75.0
+Version:        5.76.0
 Release:        0
 Summary:        Image format plugins for Qt
 License:        LGPL-2.1-or-later


++++++ kimageformats-5.75.0.tar.xz -> kimageformats-5.76.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.75.0/CMakeLists.txt 
new/kimageformats-5.76.0/CMakeLists.txt
--- old/kimageformats-5.75.0/CMakeLists.txt     2020-10-04 11:52:48.000000000 
+0200
+++ new/kimageformats-5.76.0/CMakeLists.txt     2020-11-07 12:39:10.000000000 
+0100
@@ -5,7 +5,7 @@
 set (CMAKE_CXX_STANDARD 14)
 
 include(FeatureSummary)
-find_package(ECM 5.75.0  NO_MODULE)
+find_package(ECM 5.76.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -51,7 +51,7 @@
 # 050d00 (5.13) triggers a BIC in qimageiohandler.h, in Qt 5.13, so do not 
enable that until we can require 5.14
 # https://codereview.qt-project.org/c/qt/qtbase/+/279215
 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050c00)
-add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054900)
+add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054B00)
 add_subdirectory(src)
 if (BUILD_TESTING)
     add_subdirectory(autotests)
Binary files old/kimageformats-5.75.0/autotests/read/psd/16bit-rle.png and 
new/kimageformats-5.76.0/autotests/read/psd/16bit-rle.png differ
Binary files old/kimageformats-5.75.0/autotests/read/psd/16bit-rle.psd and 
new/kimageformats-5.76.0/autotests/read/psd/16bit-rle.psd differ
Binary files 
old/kimageformats-5.75.0/autotests/read/psd/argb16-raw-affinityphoto-1.8.5.png 
and 
new/kimageformats-5.76.0/autotests/read/psd/argb16-raw-affinityphoto-1.8.5.png 
differ
Binary files 
old/kimageformats-5.75.0/autotests/read/psd/argb16-raw-affinityphoto-1.8.5.psd 
and 
new/kimageformats-5.76.0/autotests/read/psd/argb16-raw-affinityphoto-1.8.5.psd 
differ
Binary files 
old/kimageformats-5.75.0/autotests/read/psd/rgb16-raw-affinityphoto-1.8.5.png 
and 
new/kimageformats-5.76.0/autotests/read/psd/rgb16-raw-affinityphoto-1.8.5.png 
differ
Binary files 
old/kimageformats-5.75.0/autotests/read/psd/rgb16-raw-affinityphoto-1.8.5.psd 
and 
new/kimageformats-5.76.0/autotests/read/psd/rgb16-raw-affinityphoto-1.8.5.psd 
differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.75.0/src/imageformats/psd.cpp 
new/kimageformats-5.76.0/src/imageformats/psd.cpp
--- old/kimageformats-5.75.0/src/imageformats/psd.cpp   2020-10-04 
11:52:48.000000000 +0200
+++ new/kimageformats-5.76.0/src/imageformats/psd.cpp   2020-11-07 
12:39:10.000000000 +0100
@@ -87,7 +87,7 @@
     if (header.channel_count > 16) {
         return false;
     }
-    if (header.depth != 8) {
+    if (header.depth != 8 && header.depth != 16) {
         return false;
     }
     if (header.color_mode != CM_RGB) {
@@ -104,11 +104,18 @@
     s.skipRawData(section_length);
 }
 
-static quint8 readPixel(QDataStream &stream) {
+static quint8 readPixel_u16(QDataStream &stream) {
+    quint16 pixel;
+    stream >> pixel;
+    return pixel / (1 << 8);
+}
+
+static int readPixel_u8(QDataStream &stream) {
     quint8 pixel;
     stream >> pixel;
     return pixel;
 }
+
 static QRgb updateRed(QRgb oldPixel, quint8 redPixel) {
     return qRgba(redPixel, qGreen(oldPixel), qBlue(oldPixel), 
qAlpha(oldPixel));
 }
@@ -158,6 +165,14 @@
         // Ignore the other channels.
         channel_num = 4;
     }
+
+    if (compression == 1 && header.depth == 16) {
+        fmt = QImage::Format_RGBX64;
+        if (channel_num >= 4) {
+            fmt = QImage::Format_RGBA64;
+        }
+    }
+
     img = QImage(header.width, header.height, fmt);
     if (img.isNull()) {
         qWarning() << "Failed to allocate image, invalid dimensions?" << 
QSize(header.width, header.height);
@@ -186,6 +201,14 @@
         updateAlpha
     };
 
+    typedef QRgba64(*channelUpdater16)(QRgba64, quint16);
+    static const channelUpdater16 updaters64[4] = {
+        [](QRgba64 oldPixel, quint16 redPixel)  {return qRgba64((oldPixel & 
~(0xFFFFull <<  0)) | (quint64(  redPixel) <<  0));},
+        [](QRgba64 oldPixel, quint16 greenPixel){return qRgba64((oldPixel & 
~(0xFFFFull << 16)) | (quint64(greenPixel) << 16));},
+        [](QRgba64 oldPixel, quint16 bluePixel) {return qRgba64((oldPixel & 
~(0xFFFFull << 32)) | (quint64( bluePixel) << 32));},
+        [](QRgba64 oldPixel, quint16 alphaPixel){return qRgba64((oldPixel & 
~(0xFFFFull << 48)) | (quint64(alphaPixel) << 48));}
+    };
+
     if (compression) {
         // Skip row lengths.
         int skip_count = header.height * header.channel_count * 
sizeof(quint16);
@@ -194,9 +217,18 @@
         }
 
         for (unsigned short channel = 0; channel < channel_num; channel++) {
-            bool success = decodeRLEData(RLEVariant::PackBits, stream,
-                                        image_data, pixel_count,
-                                        &readPixel, updaters[channel]);
+            bool success = false;
+            if (header.depth == 8) {
+                success = decodeRLEData(RLEVariant::PackBits, stream,
+                                         image_data, pixel_count,
+                                         &readPixel_u8, updaters[channel]);
+            } else if (header.depth == 16) {
+                QRgba64 *image_data = reinterpret_cast<QRgba64*>(img.bits());
+                success = decodeRLEData(RLEVariant::PackBits16, stream,
+                                         image_data, pixel_count * 2,
+                                         &readPixel_u8, updaters64[channel]);
+            }
+
             if (!success) {
                 qDebug() << "decodeRLEData on channel" << channel << "failed";
                 return false;
@@ -205,7 +237,10 @@
     } else {
         for (unsigned short channel = 0; channel < channel_num; channel++) {
             for (unsigned i = 0; i < pixel_count; ++i) {
-                image_data[i] = updaters[channel](image_data[i], 
readPixel(stream));
+                image_data[i] = updaters[channel](
+                                        image_data[i],
+                                        header.depth == 8 ? 
readPixel_u8(stream)
+                                                          : 
readPixel_u16(stream));
             }
             // make sure we didn't try to read past the end of the stream
             if (stream.status() != QDataStream::Ok) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kimageformats-5.75.0/src/imageformats/rle_p.h 
new/kimageformats-5.76.0/src/imageformats/rle_p.h
--- old/kimageformats-5.75.0/src/imageformats/rle_p.h   2020-10-04 
11:52:48.000000000 +0200
+++ new/kimageformats-5.76.0/src/imageformats/rle_p.h   2020-11-07 
12:39:10.000000000 +0100
@@ -25,6 +25,11 @@
      */
     PackBits,
     /**
+     * Same as PackBits, but treat unpacked data as
+     * 16-bit integers.
+     */
+    PackBits16,
+    /**
      * PIC-style RLE
      *
      * Value 128 indicates a 16-bit repetition count
@@ -67,6 +72,8 @@
                                  Func2 updateItem)
 {
     unsigned offset = 0; // in dest
+    bool is_msb = true; // only used for 16-bit PackBits, data is big-endian
+    quint16 temp_data = 0;
     while (offset < length) {
         unsigned remaining = length - offset;
         quint8 count1;
@@ -85,7 +92,7 @@
                     // 2 to 128 repetitions
                     length = count1 - 127u;
                 }
-            } else if (variant == RLEVariant::PackBits) {
+            } else if (variant == RLEVariant::PackBits || variant == 
RLEVariant::PackBits16) {
                 if (count1 == 128u) {
                     // Ignore value 128
                     continue;
@@ -102,7 +109,18 @@
             }
             auto datum = readData(stream);
             for (unsigned i = offset; i < offset + length; ++i) {
-                dest[i] = updateItem(dest[i], datum);
+                if (variant == RLEVariant::PackBits16) {
+                    if (is_msb) {
+                        temp_data = datum << 8;
+                        is_msb = false;
+                    } else {
+                        temp_data |= datum;
+                        dest[i >> 1] = updateItem(dest[i >> 1], temp_data);
+                        is_msb = true;
+                    }
+                } else {
+                    dest[i] = updateItem(dest[i], datum);
+                }
             }
             offset += length;
         } else {
@@ -114,7 +132,18 @@
             }
             for (unsigned i = offset; i < offset + length; ++i) {
                 auto datum = readData(stream);
-                dest[i] = updateItem(dest[i], datum);
+                if (variant == RLEVariant::PackBits16) {
+                    if (is_msb) {
+                        temp_data = datum << 8;
+                        is_msb = false;
+                    } else {
+                        temp_data |= datum;
+                        dest[i >> 1] = updateItem(dest[i >> 1], temp_data);
+                        is_msb = true;
+                    }
+                } else {
+                    dest[i] = updateItem(dest[i], datum);
+                }
             }
             offset += length;
         }
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/[email protected]

Reply via email to