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).
This commit is contained in:
Daniel Novomeský
2026-08-24 12:02:58 +02:00
parent 42e9733060
commit 5ed0affc95
+2 -2
View File
@@ -951,8 +951,8 @@ bool HEIFHandler::ensureDecoder()
struct heif_image *img = nullptr; struct heif_image *img = nullptr;
err = heif_decode_image(handle, &img, heif_colorspace_RGB, chroma, decoder_option); 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")) { 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, probably made by a Xiaomi device!"; qCWarning(LOG_HEIFPLUGIN) << "Non-standard HEIF image with invalid matrix_coefficients!";
// second try to decode with strict decoding disabled // second try to decode with strict decoding disabled
decoder_option->strict_decoding = 0; decoder_option->strict_decoding = 0;