diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2022-10-16 11:25:04 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2022-10-16 11:25:30 +0200 |
commit | 485029605884aedb0776bcff066b87a90b896b5b (patch) | |
tree | e44b9fcac2743ad79cf522c8a36587303ab74ae0 /kde-frameworks/kimageformats/files | |
parent | media-libs/libheif: Stabilize 1.13.0 ppc64, #877181 (diff) | |
download | gentoo-485029605884aedb0776bcff066b87a90b896b5b.tar.gz gentoo-485029605884aedb0776bcff066b87a90b896b5b.tar.bz2 gentoo-485029605884aedb0776bcff066b87a90b896b5b.zip |
kde-frameworks/kimageformats: Fix AVIF performance
See also:
https://mail.kde.org/pipermail/distributions/2022-October/001309.html
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/kimageformats/files')
-rw-r--r-- | kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-1.patch | 34 | ||||
-rw-r--r-- | kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-2.patch | 32 |
2 files changed, 66 insertions, 0 deletions
diff --git a/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-1.patch b/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-1.patch new file mode 100644 index 000000000000..326ce2fd9e47 --- /dev/null +++ b/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-1.patch @@ -0,0 +1,34 @@ +From 350ce1b990460cb2178f369f22fe80803f5645f3 Mon Sep 17 00:00:00 2001 +From: Fushan Wen <qydwhotmail@gmail.com> +Date: Sat, 15 Oct 2022 11:40:41 +0800 +Subject: [PATCH] avif: return `false` in `canRead()` when `imageIndex >= + imageCount` + +Otherwise when `cache: false` is set in AnimatedImage, QMovie will try +to read the image forever. + +BUG: 460085 +FIXED-IN: 5.100 +--- + src/imageformats/avif.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp +index 2865a4e..c4f7a0f 100644 +--- a/src/imageformats/avif.cpp ++++ b/src/imageformats/avif.cpp +@@ -42,6 +42,11 @@ bool QAVIFHandler::canRead() const + + if (m_parseState != ParseAvifError) { + setFormat("avif"); ++ ++ if (m_parseState == ParseAvifSuccess && m_decoder->imageIndex >= m_decoder->imageCount - 1) { ++ return false; ++ } ++ + return true; + } + return false; +-- +GitLab + diff --git a/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-2.patch b/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-2.patch new file mode 100644 index 000000000000..8e7763b2c580 --- /dev/null +++ b/kde-frameworks/kimageformats/files/kimageformats-5.99.0-avif-perf-2.patch @@ -0,0 +1,32 @@ +From 1190e53e9b69da6f9663ceb75c4813c5708b7cbd Mon Sep 17 00:00:00 2001 +From: Fushan Wen <qydwhotmail@gmail.com> +Date: Sat, 15 Oct 2022 14:11:56 +0800 +Subject: [PATCH] avif: always indicate endless loop + +avif does not support loops but endless loop was the behavior before +460085 was fixed, so a workaround is added. + +See also: https://github.com/AOMediaCodec/libavif/issues/347 + +CCBUG: 460085 +--- + src/imageformats/avif.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp +index c4f7a0f..24aec84 100644 +--- a/src/imageformats/avif.cpp ++++ b/src/imageformats/avif.cpp +@@ -1024,7 +1024,8 @@ int QAVIFHandler::loopCount() const + return 0; + } + +- return 1; ++ // Endless loop to work around https://github.com/AOMediaCodec/libavif/issues/347 ++ return -1; + } + + QPointF QAVIFHandler::CompatibleChromacity(qreal chrX, qreal chrY) +-- +GitLab + |