Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[freeimage] Updated port to prepare for libraw version 0.21 #29605

Closed
wants to merge 12 commits into from
1 change: 1 addition & 0 deletions ports/freeimage/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vcpkg_from_sourceforge(
use-typedef-as-already-declared.patch
use-functions-to-override-libtiff-warning-error-handlers.patch
remove_auto_ptr.patch
rawlib-build-fix.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
Expand Down
31 changes: 31 additions & 0 deletions ports/freeimage/rawlib-build-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp
index c7f8758a..a57fd5f1 100644
--- a/Source/FreeImage/PluginRAW.cpp
+++ b/Source/FreeImage/PluginRAW.cpp
@@ -46,6 +46,14 @@ private:
long _eof;
INT64 _fsize;

+ // Minimal change to make version 3.18.0 of FreeImage compile with
+ // LibRaw 0.20 and later versions.
+ // Once the port of FreeImage has been updated to a version greater
+ // than 3.18.0, this patch should be removed as it will not be needed.
+#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 20)
+ LibRaw_abstract_datastream const *substream = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record the const was meant to come after the *: A const pointer, not a pointer to const.

+#endif
+
public:
LibRaw_freeimage_datastream(FreeImageIO *io, fi_handle handle) : _io(io), _handle(handle) {
long start_pos = io->tell_proc(handle);
@@ -694,7 +702,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
// --------------------------------------------

// (-s [0..N-1]) Select one raw image from input file
+#if LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(0, 20)
+ RawProcessor->imgdata.rawparams.shot_select = 0;
+#else
RawProcessor->imgdata.params.shot_select = 0;
+#endif
// (-w) Use camera white balance, if possible (otherwise, fallback to auto_wb)
RawProcessor->imgdata.params.use_camera_wb = 1;
// (-M) Use any color matrix from the camera metadata. This option only affects Olympus, Leaf, and Phase One cameras.
2 changes: 1 addition & 1 deletion ports/freeimage/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "freeimage",
"version": "3.18.0",
"port-version": 24,
"port-version": 25,
"description": "Support library for graphics image formats",
"homepage": "https://sourceforge.net/projects/freeimage/",
"license": "GPL-2.0-only OR GPL-3.0-only OR FreeImage",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,7 @@
},
"freeimage": {
"baseline": "3.18.0",
"port-version": 24
"port-version": 25
},
"freeopcua": {
"baseline": "20190125",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/freeimage.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "11a3fd352601befcb802ead59b120d0e00ac4ea1",
"version": "3.18.0",
"port-version": 25
},
{
"git-tree": "b72eaa94f12facf42b2180bf49ff9121d9477eaa",
"version": "3.18.0",
Expand Down