commit: 9d365f384660d090ca0baff6b95c67cc4005dbe9 Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru> AuthorDate: Sun Sep 6 18:09:05 2020 +0000 Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> CommitDate: Sun Sep 6 18:10:32 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9d365f38
media-plugins/qt-heif-image-plugin: load RGB888 heif images with libheif 1.7.0 Add upstream patch to fix issue. Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru> .../files/qt-heif-image-plugin-0.3.3_RGB88.patch | 49 ++++++++++++++++++++++ .../qt-heif-image-plugin-0.3.3-r1.ebuild | 24 +++++++++++ 2 files changed, 73 insertions(+) diff --git a/media-plugins/qt-heif-image-plugin/files/qt-heif-image-plugin-0.3.3_RGB88.patch b/media-plugins/qt-heif-image-plugin/files/qt-heif-image-plugin-0.3.3_RGB88.patch new file mode 100644 index 00000000..03ae7eea --- /dev/null +++ b/media-plugins/qt-heif-image-plugin/files/qt-heif-image-plugin-0.3.3_RGB88.patch @@ -0,0 +1,49 @@ +From 3288ae60b96efa404fbeb40598a8567bc8c75761 Mon Sep 17 00:00:00 2001 +From: Markus Diem <[email protected]> +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/media-plugins/qt-heif-image-plugin/qt-heif-image-plugin-0.3.3-r1.ebuild b/media-plugins/qt-heif-image-plugin/qt-heif-image-plugin-0.3.3-r1.ebuild new file mode 100644 index 00000000..67131833 --- /dev/null +++ b/media-plugins/qt-heif-image-plugin/qt-heif-image-plugin-0.3.3-r1.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Qt plugin for HEIF images" +HOMEPAGE="https://github.com/jakar/qt-heif-image-plugin" +SRC_URI="https://github.com/jakar/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-qt/qtcore + dev-qt/qtgui + >=media-libs/libheif-1.6.1:0= +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( "${FILESDIR}/${P}_RGB88.patch" )
