Unbundle: libjpeg, disable JPEG transform functions.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Jan 2014 16:50:31 +0000 (17:50 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Jan 2014 19:05:59 +0000 (20:05 +0100)
FreeImage.2008.vcproj
Source/FreeImage.h
Source/FreeImage/PluginJPEG.cpp

index babc751..55b2a4e 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="Source\FreeImageToolkit\JPEGTransform.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="Source\FreeImageToolkit\MultigridPoissonSolver.cpp"\r
                                >\r
                        </File>\r
index 17de860..54d9cea 100644 (file)
@@ -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
index b3bc9f2..d53127f 100644 (file)
@@ -35,9 +35,9 @@ extern "C" {
 #undef FAR
 #include <setjmp.h>
 
-#include "../LibJPEG/jinclude.h"
-#include "../LibJPEG/jpeglib.h"
-#include "../LibJPEG/jerror.h"
+#include <stdio.h>
+#include <jpeglib.h>
+#include <jerror.h>
 }
 
 #include "FreeImage.h"