Skip to content

Commit

Permalink
Merge pull request microsoft#4703 from UnaNancyOwen/update_freeimage
Browse files Browse the repository at this point in the history
[freeimage] Update to FreeImage 3.18.0 and Fix function overload with libjpeg-turbo 2.0.0
  • Loading branch information
alexkaratarakis authored Nov 19, 2018
2 parents 7448478 + ad65638 commit 0c7c0f4
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 12 deletions.
8 changes: 5 additions & 3 deletions ports/freeimage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ project(FreeImage C CXX)
find_package(zlib REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
if(NOT JPEG_LIBRARY_DEBUG)
set(JPEG_LIBRARY_DEBUG ${JPEG_LIBRARY_RELEASE})
endif()
find_package(TIFF REQUIRED)
find_package(OPENJPEG REQUIRED)

Expand Down Expand Up @@ -36,9 +39,8 @@ set(ROOT_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/CacheFile.h
${REAL_SOURCE_DIR}/Plugin.h
${REAL_SOURCE_DIR}/Quantizers.h
${REAL_SOURCE_DIR}/ToneMapping.h
${REAL_SOURCE_DIR}/Utilities.h
${REAL_SOURCE_DIR}/DeprecationManager/DeprecationMgr.h)

${REAL_SOURCE_DIR}/Utilities.h)

file(GLOB FREEIMAGE_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/FreeImage/*.h)
file(GLOB FREEIMAGE_TOOLKIT_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/FreeImageToolkit/*.h)
file(GLOB METADATA_PRIVATE_HEADERS ${REAL_SOURCE_DIR}/Metadata/*.h)
Expand Down
2 changes: 1 addition & 1 deletion ports/freeimage/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: freeimage
Version: 3.17.0-4
Version: 3.18.0-2
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp, libraw, jxrlib, openexr
Description: Support library for graphics image formats
40 changes: 40 additions & 0 deletions ports/freeimage/fix-function-overload.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp
index 8db177d..efa2c4e 100644
--- a/Source/FreeImage/PluginJPEG.cpp
+++ b/Source/FreeImage/PluginJPEG.cpp
@@ -503,7 +503,7 @@ marker_is_icc(jpeg_saved_marker_ptr marker) {
return FALSE. You might want to issue an error message instead.
*/
static BOOL
-jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) {
+jpeg_read_icc_profile_(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) {
jpeg_saved_marker_ptr marker;
int num_markers = 0;
int seq_no;
@@ -745,7 +745,7 @@ read_markers(j_decompress_ptr cinfo, FIBITMAP *dib) {
BYTE *icc_profile = NULL;
unsigned icc_length = 0;

- if( jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) {
+ if( jpeg_read_icc_profile_(cinfo, &icc_profile, &icc_length) ) {
// copy ICC profile data
FreeImage_CreateICCProfile(dib, icc_profile, icc_length);
// clean up
@@ -785,7 +785,7 @@ jpeg_write_comment(j_compress_ptr cinfo, FIBITMAP *dib) {
Write JPEG_APP2 marker (ICC profile)
*/
static BOOL
-jpeg_write_icc_profile(j_compress_ptr cinfo, FIBITMAP *dib) {
+jpeg_write_icc_profile_(j_compress_ptr cinfo, FIBITMAP *dib) {
// marker identifying string "ICC_PROFILE" (null-terminated)
BYTE icc_signature[12] = { 0x49, 0x43, 0x43, 0x5F, 0x50, 0x52, 0x4F, 0x46, 0x49, 0x4C, 0x45, 0x00 };

@@ -1038,7 +1038,7 @@ write_markers(j_compress_ptr cinfo, FIBITMAP *dib) {
jpeg_write_comment(cinfo, dib);

// write ICC profile
- jpeg_write_icc_profile(cinfo, dib);
+ jpeg_write_icc_profile_(cinfo, dib);

// write IPTC profile
jpeg_write_iptc_profile(cinfo, dib);
7 changes: 4 additions & 3 deletions ports/freeimage/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ include(${CMAKE_TRIPLET_FILE})
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/FreeImage)
vcpkg_download_distfile(ARCHIVE
URLS "http://downloads.sourceforge.net/freeimage/FreeImage3170.zip"
FILENAME "FreeImage3170.zip"
SHA512 703c2626c0bcfe73eb40d720f45745208ca9650a7730759680a2b38ad3f6c719a43008477032bc70b76a95761f7d4b6f901b961359d36b54ace906dd78fb391b
URLS "http://downloads.sourceforge.net/freeimage/FreeImage3180.zip"
FILENAME "FreeImage3180.zip"
SHA512 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818
)
vcpkg_extract_source_archive(${ARCHIVE})

Expand Down Expand Up @@ -40,6 +40,7 @@ vcpkg_apply_patches(
"${CMAKE_CURRENT_LIST_DIR}/use-external-webp.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-external-openexr.patch"
"${CMAKE_CURRENT_LIST_DIR}/use-freeimage-config-include.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-function-overload.patch"
)

vcpkg_configure_cmake(
Expand Down
5 changes: 2 additions & 3 deletions ports/freeimage/use-external-webp.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
diff --git a/Source/FreeImage/PluginWebP.cpp b/Source/FreeImage/PluginWebP.cpp
index 9fb0b69..c401447 100644
index 7c9f62f..c401447 100644
--- a/Source/FreeImage/PluginWebP.cpp
+++ b/Source/FreeImage/PluginWebP.cpp
@@ -24,10 +24,9 @@
@@ -24,9 +24,9 @@

#include "../Metadata/FreeImageTag.h"

-#include "../LibWebP/src/webp/decode.h"
-#include "../LibWebP/src/webp/encode.h"
-#include "../LibWebP/src/enc/vp8enci.h"
-#include "../LibWebP/src/webp/mux.h"
+#include <webp/decode.h>
+#include <webp/encode.h>
Expand Down
4 changes: 2 additions & 2 deletions ports/freeimage/use-freeimage-config-include.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/Source/FreeImage.h b/Source/FreeImage.h
index cc66b7d..cc66812 100644
index 12182cd..86a1e68 100644
--- a/Source/FreeImage.h
+++ b/Source/FreeImage.h
@@ -32,6 +32,11 @@
#define FREEIMAGE_MINOR_VERSION 17
#define FREEIMAGE_MINOR_VERSION 18
#define FREEIMAGE_RELEASE_SERIAL 0

+// vcpkg specific includes --------------------------------------------------
Expand Down

0 comments on commit 0c7c0f4

Please sign in to comment.