commit 8775f8a728c54df9bc97fbbd62a0e11177ff3cdb
Author: Yaroslav Sidlovsky <zawertun(a)gmail.com>
Date: Mon Oct 9 11:36:02 2023 +0300
Revert "version 0.3.4"
This reverts commit 5c4d4cda4966e7dee11b61787cbcb19b860153c5.
.gitignore | 2 +-
qt-heif-image-plugin-fix-libheif-1.7.0.patch | 49 ++++++++++++++++++++++++++++
qt-heif-image-plugin.spec | 10 +++---
sources | 2 +-
4 files changed, 56 insertions(+), 7 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2609919..7f859ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-qt-heif-image-plugin-*.tar.gz
+/qt-heif-image-plugin-0.3.3.tar.gz
diff --git a/qt-heif-image-plugin-fix-libheif-1.7.0.patch
b/qt-heif-image-plugin-fix-libheif-1.7.0.patch
new file mode 100644
index 0000000..03ae7ee
--- /dev/null
+++ b/qt-heif-image-plugin-fix-libheif-1.7.0.patch
@@ -0,0 +1,49 @@
+From 3288ae60b96efa404fbeb40598a8567bc8c75761 Mon Sep 17 00:00:00 2001
+From: Markus Diem <diemmarkus(a)gmail.com>
+Date: Mon, 22 Jun 2020 11:12:12 +0200
+Subject: [PATCH] maps color format from HEIF to Qt (i.e. RGB88)
+
+- this patch is needed to load RGB888 heif images with libheif 1.7.0
+- maps heif_chroma_interleaved_RGB to QImage::Format_RGB888
+- other conversions are not added because I don't have test images
+---
+ src/qheifhandler.cpp | 20 +++++++++++++++++++-
+ 1 file changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/src/qheifhandler.cpp b/src/qheifhandler.cpp
+index e1b9933..822c45d 100644
+--- a/src/qheifhandler.cpp
++++ b/src/qheifhandler.cpp
+@@ -288,13 +288,31 @@ bool QHeifHandler::read(QImage* destImage)
+ qWarning("QHeifHandler::read() invalid stride: %d", stride);
+ return false;
+ }
++
++ // map image format
++ heif_chroma heifFormat = heif_image_get_chroma_format(srcImage.get());
++ QImage::Format qtFormat;
+
++ switch (heifFormat) {
++ case heif_chroma_interleaved_RGB: {
++ qtFormat = QImage::Format_RGB888;
++ break;
++ }
++ case heif_chroma_interleaved_RGBA: {
++ qtFormat = QImage::Format_RGBA8888;
++ break;
++ }
++ // TODO: add other formats i.e. heif_chroma_monochrome here
++ default:
++ qtFormat = QImage::Format_RGBA8888;
++ }
++
+ // move data ownership to QImage
+ heif_image* dataImage = srcImage.release();
+
+ *destImage = QImage(
+ data, imgSize.width(), imgSize.height(),
+- stride, QImage::Format_RGBA8888,
++ stride, qtFormat,
+ [](void* img) { heif_image_release(static_cast<heif_image*>(img)); },
+ dataImage
+ );
diff --git a/qt-heif-image-plugin.spec b/qt-heif-image-plugin.spec
index 43164b5..fa6ca09 100644
--- a/qt-heif-image-plugin.spec
+++ b/qt-heif-image-plugin.spec
@@ -1,14 +1,17 @@
%undefine __cmake_in_source_build
Name: qt-heif-image-plugin
-Version: 0.3.4
-Release: 1%{?dist}
+Version: 0.3.3
+Release: 8%{?dist}
Summary: Qt plugin for HEIF images
License: LGPLv3
URL:
https://github.com/jakar/qt-heif-image-plugin
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+#
https://github.com/jakar/qt-heif-image-plugin/issues/17
+Patch0: qt-heif-image-plugin-fix-libheif-1.7.0.patch
+
BuildRequires: cmake3
BuildRequires: gcc-c++
BuildRequires: cmake(Qt5)
@@ -39,9 +42,6 @@ BuildRequires: qt5-rpm-macros
%changelog
-* Mon Oct 09 2023 Yaroslav Sidlovsky <zawertun(a)gmail.com> - 0.3.4-1
-- version 0.3.4
-
* Wed Aug 02 2023 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
0.3.3-8
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
diff --git a/sources b/sources
index c771f5f..a9e1061 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (qt-heif-image-plugin-0.3.4.tar.gz) =
bdb2cf797d897408c31ffb4b84cd29ce5755a633ec38bbf8ce307f1ed0cc274203d11f3450450536ddc7f4ff4621f73d2c84fd7133dd00c16775f538133c03f5
+SHA512 (qt-heif-image-plugin-0.3.3.tar.gz) =
ba617d11e73d73dee5220b668918e313b6d856cabc1567b9221ddb2b3d35c4bfefadcd9e4485bdc7c280be104d09c3580e245d9a8f72c9fac397ebe84fe55e2f