From 2e21e11318c441da0a82931548ba9ec67285e7c7 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Tue, 17 Dec 2024 21:35:59 +0800 Subject: [PATCH] Fix test_exif compilation when non of JPEG, PNG, AVIF is enabled When none of JPEG, PNG, AVIF is enabled, exif_files is a zero-length array, which is prohibited by C++ reference. --- modules/imgcodecs/test/test_exif.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/imgcodecs/test/test_exif.cpp b/modules/imgcodecs/test/test_exif.cpp index 62cd471e23..d1a9e720a9 100644 --- a/modules/imgcodecs/test/test_exif.cpp +++ b/modules/imgcodecs/test/test_exif.cpp @@ -2,6 +2,9 @@ // It is subject to the license terms in the LICENSE file found in the top-level // directory of this distribution and at http://opencv.org/license.html +#include +#include + #include "test_precomp.hpp" namespace opencv_test { namespace { @@ -110,7 +113,7 @@ TEST_P(Exif, exif_orientation) } } -const string exif_files[] = +const std::vector exif_files { #ifdef HAVE_JPEG "readwrite/testExifOrientation_1.jpg",