freeimage: Add patch to fix build with libtiff 4.4.0

This commit is contained in:
Kevin Mehall 2022-06-02 21:44:57 +00:00
parent 25c990a60b
commit 5dcb09d3cb
2 changed files with 16 additions and 1 deletions

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation {
# Ensure that the bundled libraries are not used at all
prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
patches = [ ./unbundle.diff ];
patches = [ ./unbundle.diff ./libtiff-4.4.0.diff ];
postPatch = ''
# To support cross compilation, use the correct `pkg-config`.

View file

@ -0,0 +1,15 @@
Fix build with libtiff 4.4.0 by not using a private libtiff API.
Patch by Kurt Schwehr: https://sourceforge.net/p/freeimage/discussion/36109/thread/2018fdc6e7/
diff -ru a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp
--- a/Source/Metadata/XTIFF.cpp
+++ b/Source/Metadata/XTIFF.cpp
@@ -749,7 +749,7 @@
continue;
}
// type of storage may differ (e.g. rationnal array vs float array type)
- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) {
+ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) {
// skip tag or _TIFFmemcpy will fail
continue;
}