Fix for FreeImage incorrect image format enum after disabling vendor plugins (#15393)

This commit is contained in:
Gilad Bauman 2021-01-05 22:12:52 +02:00 committed by GitHub
parent 35e978a884
commit 109ce45742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Source: freeimage
Version: 3.18.0
Port-Version: 17
Port-Version: 18
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr
Homepage: https://sourceforge.net/projects/freeimage/
Description: Support library for graphics image formats

View File

@ -18,6 +18,7 @@ vcpkg_from_sourceforge(
fix-function-overload.patch
use-typedef-as-already-declared.patch
use-functions-to-override-libtiff-warning-error-handlers.patch
update_format_enum_values.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

View File

@ -0,0 +1,33 @@
diff --git a/Source/FreeImage.h b/Source/FreeImage.h
index 59de277..224877f 100644
--- a/Source/FreeImage.h
+++ b/Source/FreeImage.h
@@ -420,15 +420,19 @@ FI_ENUM(FREE_IMAGE_FORMAT) {
#if 0
FIF_FAXG3 = 27,
#endif
- FIF_SGI = 28,
- FIF_EXR = 29,
- FIF_J2K = 30,
- FIF_JP2 = 31,
- FIF_PFM = 32,
- FIF_PICT = 33,
- FIF_RAW = 34,
- FIF_WEBP = 35,
- FIF_JXR = 36
+/* vcpkg: removal of G3 fax format messes up the format enum numbering due to FreeImage
+ relying on the list of plugins as created in AddNode(). Enum values have been
+ corrected to compensate. This is similar to the reported bug:
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841089 */
+ FIF_SGI = 27,
+ FIF_EXR = 28,
+ FIF_J2K = 29,
+ FIF_JP2 = 30,
+ FIF_PFM = 31,
+ FIF_PICT = 32,
+ FIF_RAW = 33,
+ FIF_WEBP = 34,
+ FIF_JXR = 35
};
/** Image type used in FreeImage.