From 91a12bd48d1a1610f8bf715787801ae9b289ee81 Mon Sep 17 00:00:00 2001 From: D-mo Date: Thu, 19 Sep 2024 09:12:01 -0400 Subject: [PATCH] fix: Respect EXIF rotate flag (#1568) --- src/modules/image/util/image_loader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/image/util/image_loader.cpp b/src/modules/image/util/image_loader.cpp index 603b7cd073..e95d506ca4 100644 --- a/src/modules/image/util/image_loader.cpp +++ b/src/modules/image/util/image_loader.cpp @@ -66,9 +66,9 @@ std::shared_ptr load_image(const std::wstring& filename) CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info("Unsupported image format.")); #ifdef WIN32 - auto bitmap = std::shared_ptr(FreeImage_LoadU(fif, filename.c_str(), 0), FreeImage_Unload); + auto bitmap = std::shared_ptr(FreeImage_LoadU(fif, filename.c_str(), JPEG_EXIFROTATE), FreeImage_Unload); #else - auto bitmap = std::shared_ptr(FreeImage_Load(fif, u8(filename).c_str(), 0), FreeImage_Unload); + auto bitmap = std::shared_ptr(FreeImage_Load(fif, u8(filename).c_str(), JPEG_EXIFROTATE), FreeImage_Unload); #endif if (FreeImage_GetBPP(bitmap.get()) != 32) { @@ -94,7 +94,7 @@ std::shared_ptr load_png_from_memory(const void* memory_location, size auto memory = std::unique_ptr( FreeImage_OpenMemory(static_cast(const_cast(memory_location)), static_cast(size)), FreeImage_CloseMemory); - auto bitmap = std::shared_ptr(FreeImage_LoadFromMemory(fif, memory.get(), 0), FreeImage_Unload); + auto bitmap = std::shared_ptr(FreeImage_LoadFromMemory(fif, memory.get(), JPEG_EXIFROTATE), FreeImage_Unload); if (FreeImage_GetBPP(bitmap.get()) != 32) { bitmap = std::shared_ptr(FreeImage_ConvertTo32Bits(bitmap.get()), FreeImage_Unload);