From 19813e79cfb9aa5474a1b8d45d31d1352c4b2a85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 14 Jan 2014 17:50:31 +0100 Subject: [PATCH] Unbundle: libjpeg, disable JPEG transform functions. --- FreeImage.2008.vcproj | 4 ---- Source/FreeImage.h | 15 +++++++++++++++ Source/FreeImage/PluginJPEG.cpp | 6 +++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/FreeImage.2008.vcproj b/FreeImage.2008.vcproj index babc751..55b2a4e 100644 --- a/FreeImage.2008.vcproj +++ b/FreeImage.2008.vcproj @@ -832,10 +832,6 @@ > - - diff --git a/Source/FreeImage.h b/Source/FreeImage.h index 17de860..54d9cea 100644 --- a/Source/FreeImage.h +++ b/Source/FreeImage.h @@ -456,6 +456,10 @@ FI_ENUM(FREE_IMAGE_DITHER) { FID_BAYER16x16 = 6 // Bayer ordered dispersed dot dithering (order 4 dithering matrix) }; +/* The FreeImage_JPEGTransform functions are deliberately disabled in the + Fedora build of FreeImage as they require that FreeImage uses a private copy + of libjpeg which is a no no because of security reasons. */ +#if 0 /** Lossless JPEG transformations Constants used in FreeImage_JPEGTransform */ @@ -469,6 +473,7 @@ FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { FIJPEG_OP_ROTATE_180 = 6, // 180-degree rotation FIJPEG_OP_ROTATE_270 = 7 // 270-degree clockwise (or 90 ccw) }; +#endif /** Tone mapping operators. Constants used in FreeImage_ToneMapping. @@ -1047,8 +1052,13 @@ DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, con DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask); DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib); DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib); +/* The FreeImage_JPEGTransform functions are deliberately disabled in the + Fedora build of FreeImage as they require that FreeImage uses a private copy + of libjpeg which is a no no because of security reasons. */ +#if 0 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); +#endif // upsampling / downsampling DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter); @@ -1078,8 +1088,13 @@ DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *s DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom); DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha); DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL)); +/* The FreeImage_JPEGTransform functions are deliberately disabled in the + Fedora build of FreeImage as they require that FreeImage uses a private copy + of libjpeg which is a no no because of security reasons. */ +#if 0 DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCropU(const wchar_t *src_file, const wchar_t *dst_file, int left, int top, int right, int bottom); +#endif DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib); // background filling routines diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp index b3bc9f2..d53127f 100644 --- a/Source/FreeImage/PluginJPEG.cpp +++ b/Source/FreeImage/PluginJPEG.cpp @@ -35,9 +35,9 @@ extern "C" { #undef FAR #include -#include "../LibJPEG/jinclude.h" -#include "../LibJPEG/jpeglib.h" -#include "../LibJPEG/jerror.h" +#include +#include +#include } #include "FreeImage.h" -- 1.8.2.3