[SCM] qtimageformats packaging branch, experimental, updated. debian/5.3.0-2-2-gd05ebbf
Lisandro Damián Nicanor Pérez
lisandro at moszumanska.debian.org
Wed Jun 4 21:26:41 UTC 2014
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtimageformats.git;a=commitdiff;h=d05ebbf
The following commit has been merged in the experimental branch:
commit d05ebbfe88d75dd375bb43a9e0ce974c84a26aec
Author: Lisandro Damián Nicanor Pérez Meyer <perezmeyer at gmail.com>
Date: Wed Jun 4 18:26:28 2014 -0300
Backport make_qwebphandler_write_work_on_big_endian_systems.patch.
---
debian/changelog | 5 +++
...phandler_write_work_on_big_endian_systems.patch | 51 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 57 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 6240292..8978ccf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
qtimageformats-opensource-src (5.3.0-3) UNRELEASED; urgency=medium
+ [ Lisandro Damián Nicanor Pérez Meyer ]
+ * Backport Dmitry Shachnev's
+ make_qwebphandler_write_work_on_big_endian_systems.patch to properly handle
+ big endian machines.
+
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Wed, 04 Jun 2014 18:24:37 -0300
qtimageformats-opensource-src (5.3.0-2) experimental; urgency=medium
diff --git a/debian/patches/make_qwebphandler_write_work_on_big_endian_systems.patch b/debian/patches/make_qwebphandler_write_work_on_big_endian_systems.patch
new file mode 100644
index 0000000..479443e
--- /dev/null
+++ b/debian/patches/make_qwebphandler_write_work_on_big_endian_systems.patch
@@ -0,0 +1,51 @@
+From 88efc26966c75df099345a3ce9aa3c146ecfc9a7 Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57 at gmail.com>
+Date: Thu, 29 May 2014 10:58:33 +0400
+Subject: [PATCH] Make QWebpHandler::write() work on big endian systems
+
+Currently, we convert image to Format_ARGB32. This means that on big
+endian systems the order of bytes will be (0xAA, 0xRR, 0xGG, 0xBB).
+However, in WebP library there is no function to import bytes in
+ARGB format.
+
+This commit makes us use Format_RGBA8888 and WebPPictureImportRGBA
+on big endian systems, which will make the function work correctly.
+
+Change-Id: I5f347f3ec66f0a57df0d40d4900b1573f9400506
+---
+ src/plugins/imageformats/webp/qwebphandler.cpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp
+index 8834820..599cb00 100644
+--- a/src/plugins/imageformats/webp/qwebphandler.cpp
++++ b/src/plugins/imageformats/webp/qwebphandler.cpp
+@@ -137,8 +137,13 @@ bool QWebpHandler::write(const QImage &image)
+ }
+
+ QImage srcImage = image;
++#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ if (srcImage.format() != QImage::Format_ARGB32)
+ srcImage = srcImage.convertToFormat(QImage::Format_ARGB32);
++#else /* Q_BIG_ENDIAN */
++ if (srcImage.format() != QImage::Format_RGBA8888)
++ srcImage = srcImage.convertToFormat(QImage::Format_RGBA8888);
++#endif
+
+ WebPPicture picture;
+ WebPConfig config;
+@@ -151,7 +156,11 @@ bool QWebpHandler::write(const QImage &image)
+ picture.width = srcImage.width();
+ picture.height = srcImage.height();
+ picture.use_argb = 1;
++#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ if (!WebPPictureImportBGRA(&picture, srcImage.bits(), srcImage.bytesPerLine())) {
++#else /* Q_BIG_ENDIAN */
++ if (!WebPPictureImportRGBA(&picture, srcImage.bits(), srcImage.bytesPerLine())) {
++#endif
+ qWarning() << "failed to import image data to webp picture.";
+
+ WebPPictureFree(&picture);
+--
+2.0.0
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1d950e0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+make_qwebphandler_write_work_on_big_endian_systems.patch
--
qtimageformats packaging
More information about the pkg-kde-commits
mailing list