mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
imgcodecs: drop bundled OpenEXR
This commit is contained in:
committed by
Alexander Smorkalov
parent
9bd246dd05
commit
b96e9fd1ce
@@ -80,13 +80,6 @@ endif()
|
||||
if(HAVE_OPENEXR)
|
||||
include_directories(SYSTEM ${OPENEXR_INCLUDE_PATHS})
|
||||
list(APPEND GRFMT_LIBS ${OPENEXR_LIBRARIES})
|
||||
if(OPENCV_IO_FORCE_OPENEXR
|
||||
OR NOT BUILD_OPENEXR # external OpenEXR versions are not disabled
|
||||
)
|
||||
add_definitions(-DOPENCV_IMGCODECS_USE_OPENEXR=1)
|
||||
else()
|
||||
message(STATUS "imgcodecs: OpenEXR codec is disabled in runtime. Details: https://github.com/opencv/opencv/issues/21326")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(HAVE_PNG OR HAVE_TIFF OR HAVE_OPENEXR OR HAVE_SPNG OR HAVE_JPEGXL)
|
||||
@@ -202,9 +195,6 @@ ocv_add_accuracy_tests()
|
||||
if(TARGET opencv_test_imgcodecs AND HAVE_JASPER AND "$ENV{OPENCV_IO_ENABLE_JASPER}")
|
||||
ocv_target_compile_definitions(opencv_test_imgcodecs PRIVATE OPENCV_IMGCODECS_ENABLE_JASPER_TESTS=1)
|
||||
endif()
|
||||
if(TARGET opencv_test_imgcodecs AND HAVE_OPENEXR AND "$ENV{OPENCV_IO_ENABLE_OPENEXR}")
|
||||
ocv_target_compile_definitions(opencv_test_imgcodecs PRIVATE OPENCV_IMGCODECS_ENABLE_OPENEXR_TESTS=1)
|
||||
endif()
|
||||
if(TARGET opencv_test_imgcodecs AND ((HAVE_PNG AND NOT (PNG_VERSION_STRING VERSION_LESS "1.6.31")) OR HAVE_SPNG))
|
||||
# details: https://github.com/glennrp/libpng/commit/68cb0aaee3de6371b81a4613476d9b33e43e95b1
|
||||
ocv_target_compile_definitions(opencv_test_imgcodecs PRIVATE OPENCV_IMGCODECS_PNG_WITH_EXIF=1)
|
||||
|
||||
@@ -83,27 +83,6 @@
|
||||
namespace cv
|
||||
{
|
||||
|
||||
static bool isOpenEXREnabled()
|
||||
{
|
||||
static const bool PARAM_ENABLE_OPENEXR = utils::getConfigurationParameterBool("OPENCV_IO_ENABLE_OPENEXR",
|
||||
#ifdef OPENCV_IMGCODECS_USE_OPENEXR
|
||||
true
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
);
|
||||
return PARAM_ENABLE_OPENEXR;
|
||||
}
|
||||
static void initOpenEXR()
|
||||
{
|
||||
if (!isOpenEXREnabled())
|
||||
{
|
||||
const char* message = "imgcodecs: OpenEXR codec is disabled. You can enable it via 'OPENCV_IO_ENABLE_OPENEXR' option. Refer for details and cautions here: https://github.com/opencv/opencv/issues/21326";
|
||||
CV_LOG_WARNING(NULL, message);
|
||||
CV_Error(Error::StsNotImplemented, message);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////// ExrDecoder ///////////////////
|
||||
|
||||
ExrDecoder::ExrDecoder()
|
||||
@@ -692,7 +671,6 @@ void ExrDecoder::RGBToGray( float *in, float *out )
|
||||
|
||||
ImageDecoder ExrDecoder::newDecoder() const
|
||||
{
|
||||
initOpenEXR();
|
||||
return makePtr<ExrDecoder>();
|
||||
}
|
||||
|
||||
@@ -869,7 +847,6 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& params )
|
||||
|
||||
ImageEncoder ExrEncoder::newEncoder() const
|
||||
{
|
||||
initOpenEXR();
|
||||
return makePtr<ExrEncoder>();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
// This file is part of OpenCV project.
|
||||
// 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 "test_precomp.hpp"
|
||||
|
||||
//#define GENERATE_DATA
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
|
||||
#ifdef HAVE_OPENEXR
|
||||
|
||||
size_t getFileSize(const string& filename)
|
||||
{
|
||||
std::ifstream ifs(filename.c_str(), std::ios::in | std::ios::binary);
|
||||
@@ -341,5 +344,6 @@ TEST(Imgcodecs_EXR, imwrite_regression_26207_extra)
|
||||
remove(filename.c_str());
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENEXR
|
||||
|
||||
}} // namespace
|
||||
@@ -507,7 +507,3 @@ TEST(Imgcodecs, imdecode_user_buffer)
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
#if defined(HAVE_OPENEXR) && defined(OPENCV_IMGCODECS_ENABLE_OPENEXR_TESTS)
|
||||
#include "test_exr.impl.hpp"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user