1
0
forked from pool/kimageformats
Christophe Giboudeaux 2022-11-12 09:49:05 +00:00 committed by Git OBS Bridge
parent 28c6eb2201
commit 36d582808e
9 changed files with 53 additions and 138 deletions

View File

@ -1,32 +0,0 @@
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)
--
2.38.0

View File

@ -1,34 +0,0 @@
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;
--
2.38.0

View File

@ -1,51 +0,0 @@
From f475a4b24a166d7582163753bc2f4f254257daed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Novomesk=C3=BD?= <dnovomesky@gmail.com>
Date: Tue, 11 Oct 2022 14:36:17 +0200
Subject: [PATCH] avif: revert 9ac923ad09316dcca0fc11e0be6b3dfc6cce6ca0 commit
Changes to libavif's avifImageRGBToYUV() API were reverted too.
---
src/imageformats/avif.cpp | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp
index ccb4c56..7721c1b 100644
--- a/src/imageformats/avif.cpp
+++ b/src/imageformats/avif.cpp
@@ -336,7 +336,7 @@ bool QAVIFHandler::decode_one_frame()
rgb.format = AVIF_RGB_FORMAT_ARGB;
#endif
-#if (AVIF_VERSION >= 80400) && (AVIF_VERSION <= 100100)
+#if AVIF_VERSION >= 80400
if (m_decoder->imageCount > 1) {
/* accelerate animated AVIF */
rgb.chromaUpsampling = AVIF_CHROMA_UPSAMPLING_FASTEST;
@@ -351,12 +351,7 @@ bool QAVIFHandler::decode_one_frame()
rgb.rowBytes = result.bytesPerLine();
rgb.pixels = result.bits();
-#if AVIF_VERSION >= 100101
- // use faster decoding for animations
- avifResult res = avifImageYUVToRGB(m_decoder->image, &rgb, (m_decoder->imageCount > 1) ? AVIF_CHROMA_UPSAMPLING_NEAREST : AVIF_YUV_TO_RGB_DEFAULT);
-#else
avifResult res = avifImageYUVToRGB(m_decoder->image, &rgb);
-#endif
if (res != AVIF_RESULT_OK) {
qWarning("ERROR in avifImageYUVToRGB: %s", avifResultToString(res));
return false;
@@ -782,11 +777,7 @@ bool QAVIFHandler::write(const QImage &image)
}
}
-#if AVIF_VERSION >= 100101
- res = avifImageRGBToYUV(avif, &rgb, AVIF_RGB_TO_YUV_DEFAULT);
-#else
res = avifImageRGBToYUV(avif, &rgb);
-#endif
if (res != AVIF_RESULT_OK) {
qWarning("ERROR in avifImageRGBToYUV: %s", avifResultToString(res));
return false;
--
2.38.0

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cbb5253d55c0ac09689b772f0723a42c290e8df3448116f556f5d320c6738827
size 12669456

View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmNpCyUACgkQWNDuZIpI
s7vxXwf5AQz8lgsZzITeskq/K+43TTVOyL5h4eEZkZ1eq041fL+PujPaZ5yiCAzr
v6Dzk2WPV+UAHk3Uojz/dIdJ5ht1SAnEa9TEHK4juxPOTlPrYyUyw4VCnFzyeXY8
5/WVXB2ItPqO/mA5J4MuX+77EgZ3HJoaYYt9OKoZRg8Yqbr5sP2WHD/5XqpZXsKz
lqWuOMjzuAVQOW9N64XMtzVP5WiivvwSaSqM1D1Uv20XXGnk9edPdvLTqwlV4G8h
e7nqUZoxINH8HL+SyP53LLNzL4dNRWDnnvVd+0dMbstSn1JXjwtk6EjBFyizOvbD
2rqZHSpqcGH1ZcQ4v1lpbHiVw+yfWg==
=2lIw
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06e636d4fe03d8d1b0bfed728d00c83fa639e2990fd5664a7101bd77621db1ee
size 12298368

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmM4VYYACgkQWNDuZIpI
s7vUdQgAp3FrS3AyXAvvjp2FaRgWQ52A0N7FpU3Ky7cea/Usth3AXOZrFUUPu5VZ
Ykw1YZo1vPtZgzeYYR8bfLv1jgjBtkWAADTwDqt3x9H9ayFvDAH8aYsNOu2ZUEuv
HyXM2NeoCLh4XYHHIPuVXBQfyR4f01Dom+FSP8jdU08EasfQFme+3um1WZgBtcO/
2k38q55ryfS2hWPVFFoCUZyOd+TI5jeWN7qETFTEdP3oY2xdH/QlpYvhpYfRrUMZ
3WFbQgM8xgJTRxFbcrHAbdR/tnItMh85O72pp/9kurlRm6BI/+i3bW6OxVOGScim
6uSGnr1FEJ7CUDP7YSujHGDZrY+H4Q==
=xjsP
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,39 @@
-------------------------------------------------------------------
Tue Nov 8 08:35:11 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 5.100.0
* New feature release
* For more details please see:
* https://kde.org/announcements/frameworks/5/5.100.0
- Changes since 5.99.0:
* Don't install desktop files for image formats when building against Qt6
* raw: Don't seek back if we were asked to read too much
* jxl: indicate when all frames have been read
* avif: minor fixes
* avif: indicate when all frames have been read
* avif: always indicate endless loop
* avif: return `false` in `canRead()` when `imageIndex >= imageCount` (kde#460085)
* Add JXL test files corresponding to 8 EXIF orientation values
* Add AVIF test files with rotation and mirror operations
* Auto-rotate input images in readtest
* jxl: remove C-style casts
* avif: Use reinterpret_cast instead C cast
* avif: revert 9ac923a commit
* heif: replace C cast with static_cast
* heif: use heif_init/heif_deinit with libheif 1.13.0+
* FindLibRaw: fix include dir, should not contain prefix libraw/ (kde#460105)
* Fix duplicated tests
* ANI partial test and PIC test added
* PSD: impreved support to sequential access device
* Fix messages
* CMakeLists: enable EXR test
* Added EXR test image
* Fixes for sequential devices
- Drop patches, merged upstream:
* 0001-avif-return-false-in-canRead-when-imageIndex-imageCo.patch
* 0001-avif-always-indicate-endless-loop.patch
* 0001-avif-revert-9ac923ad09316dcca0fc11e0be6b3dfc6cce6ca0.patch
-------------------------------------------------------------------
Wed Oct 19 09:50:52 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>

View File

@ -25,7 +25,7 @@
%if 0%{?suse_version} > 1500 || (0%{?is_opensuse} && 0%{?sle_version} > 150400)
%define with_jxl 1
%endif
%define _tar_path 5.99
%define _tar_path 5.100
# Full KF5 version (e.g. 5.33.0)
%{!?_kf5_version: %global _kf5_version %{version}}
# Last major and minor KF5 version (e.g. 5.33)
@ -33,7 +33,7 @@
# Only needed for the package signature condition
%bcond_without released
Name: kimageformats
Version: 5.99.0
Version: 5.100.0
Release: 0
Summary: Image format plugins for Qt
License: LGPL-2.1-or-later
@ -44,11 +44,6 @@ Source: %{name}-%{version}.tar.xz
Source1: %{name}-%{version}.tar.xz.sig
Source2: frameworks.keyring
%endif
# PATCH-FIX-UPSTREAM -- Recommended patches for kimageformats 5.99
Patch0: 0001-avif-return-false-in-canRead-when-imageIndex-imageCo.patch
Patch1: 0001-avif-always-indicate-endless-loop.patch
# PATCH-FIX-UPSTREAM
Patch2: 0001-avif-revert-9ac923ad09316dcca0fc11e0be6b3dfc6cce6ca0.patch
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes
BuildRequires: kf5-filesystem
@ -155,5 +150,6 @@ environments.
%dir %{_kf5_servicesdir}/qimageioplugins
%{_kf5_plugindir}/imageformats/kimg_eps.so
%{_kf5_servicesdir}/qimageioplugins/eps.desktop
%{_kf5_plugindir}/imageformats/kimg_eps.so
%changelog