From 5ed0affc95a7fe70b8b906061d02239c7b43e92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Novomesk=C3=BD?= Date: Fri, 21 Aug 2026 17:57:41 +0200 Subject: [PATCH] heif: re-enable decoding of non-standard images BUG: 495686 IMG_20241019_195232.heic stopped decoding recently because buffer.contains("Xiaomi") is almost all the time false (only start of the file is stored now), except sequential devices (full file is stored). --- src/imageformats/heif.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imageformats/heif.cpp b/src/imageformats/heif.cpp index 973b07a..84b2e00 100644 --- a/src/imageformats/heif.cpp +++ b/src/imageformats/heif.cpp @@ -951,8 +951,8 @@ bool HEIFHandler::ensureDecoder() struct heif_image *img = nullptr; err = heif_decode_image(handle, &img, heif_colorspace_RGB, chroma, decoder_option); - if (err.code == heif_error_Invalid_input && err.subcode == heif_suberror_Unknown_NCLX_matrix_coefficients && img == nullptr && buffer.contains("Xiaomi")) { - qCWarning(LOG_HEIFPLUGIN) << "Non-standard HEIF image with invalid matrix_coefficients, probably made by a Xiaomi device!"; + if (err.code == heif_error_Invalid_input && err.subcode == heif_suberror_Unknown_NCLX_matrix_coefficients && img == nullptr) { + qCWarning(LOG_HEIFPLUGIN) << "Non-standard HEIF image with invalid matrix_coefficients!"; // second try to decode with strict decoding disabled decoder_option->strict_decoding = 0;