46 lines
1.4 KiB
Diff
46 lines
1.4 KiB
Diff
From bcec942cc92e0968c724a2c1f92b4cd048bf8fa7 Mon Sep 17 00:00:00 2001
|
|
From: Antonio Rojas <arojas@archlinux.org>
|
|
Date: Tue, 29 Aug 2023 09:21:37 +0200
|
|
Subject: [PATCH] Support libavif 1.0
|
|
|
|
Make cmake find libavif 1.0 and adapt to API changes (which is reverting to pre 0.9.2 API)
|
|
|
|
(cherry picked from commit 4badb3088e90d86208ed6bd435df7fe6a022be64)
|
|
---
|
|
CMakeLists.txt | 5 ++++-
|
|
src/imageformats/avif.cpp | 2 +-
|
|
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 2597a00..6d0af2e 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -51,7 +51,10 @@ set_package_properties(OpenEXR PROPERTIES
|
|
PURPOSE "Required for the QImage plugin for OpenEXR images"
|
|
)
|
|
|
|
-find_package(libavif 0.8.2 CONFIG)
|
|
+find_package(libavif 0.8.2 CONFIG QUIET)
|
|
+if(NOT libavif_FOUND)
|
|
+ find_package(libavif 1 CONFIG)
|
|
+endif()
|
|
set_package_properties(libavif PROPERTIES
|
|
TYPE OPTIONAL
|
|
PURPOSE "Required for the QImage plugin for AVIF images"
|
|
diff --git a/src/imageformats/avif.cpp b/src/imageformats/avif.cpp
|
|
index bcebd36..9775dcb 100644
|
|
--- a/src/imageformats/avif.cpp
|
|
+++ b/src/imageformats/avif.cpp
|
|
@@ -424,7 +424,7 @@ bool QAVIFHandler::decode_one_frame()
|
|
}
|
|
|
|
if (m_decoder->image->transformFlags & AVIF_TRANSFORM_IMIR) {
|
|
-#if AVIF_VERSION > 90100
|
|
+#if AVIF_VERSION > 90100 && AVIF_VERSION < 1000000
|
|
switch (m_decoder->image->imir.mode) {
|
|
#else
|
|
switch (m_decoder->image->imir.axis) {
|
|
--
|
|
2.41.0
|
|
|