Add upstream patch that fix compatibility with latest libavif

This commit is contained in:
Robert-André Mauchin 2022-10-24 07:08:27 +02:00
parent 67b76114ef
commit 2201171f62
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,38 @@
diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp
index ccb4c56b3746775ab0f9eecdde5692b7383848d9..7721c1b79bf6e6ca7261fedc4d9c8c147e71ccbb 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;

View File

@ -23,6 +23,7 @@ Source0: http://download.kde.org/%{stable}/frameworks/%{majmin}/%{framewo
# Upastream patches
Patch0: 350ce1b990460cb2178f369f22fe80803f5645f3.diff
Patch1: 1190e53e9b69da6f9663ceb75c4813c5708b7cbd.diff
Patch2: f475a4b24a166d7582163753bc2f4f254257daed.diff
BuildRequires: extra-cmake-modules >= %{majmin}
BuildRequires: jasper-devel