summaryrefslogtreecommitdiff
path: root/graphics/freeimage
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2020-01-11 14:40:44 +0000
committernia <nia@pkgsrc.org>2020-01-11 14:40:44 +0000
commit638ee4d77f1bd13189947f60699fc59710b42355 (patch)
tree28946b548c05044452da64badbfed909d11f56ad /graphics/freeimage
parentcd4a12e8fee535620a116e60c94a4bef5099b964 (diff)
downloadpkgsrc-638ee4d77f1bd13189947f60699fc59710b42355.tar.gz
freeimage: Update to 3.18.0
Release 3.18.0 is a maintenance release that mainly brings updates of its third party libraries. The library has been updated with the new ZLib (1.2.11), LibJPEG (9c), LibPNG (1.6.35), LibTIFF (4.0.9), LibRaw (0.19.0), LibWebP (1.0.0), OpenEXR (2.2.1). Other significant improvements concern better support for JPEG saving (when using 32-bit CMYK images) and PSD saving. Lastly, the library contains many bug fixes provided by our users (will concern especially plugins PCX, TIFF, XPM, GIF, TARGA, PSD, BMP, DDS, PNG, HDR). As usual, check the changes log for full details (especially for bug fixes) and check also the updated FreeImage documentation.
Diffstat (limited to 'graphics/freeimage')
-rw-r--r--graphics/freeimage/Makefile7
-rw-r--r--graphics/freeimage/distinfo18
-rw-r--r--graphics/freeimage/patches/patch-Makefile4
-rw-r--r--graphics/freeimage/patches/patch-Makefile.fip4
-rw-r--r--graphics/freeimage/patches/patch-Source_FreeImage_PluginPCX.cpp220
-rw-r--r--graphics/freeimage/patches/patch-Source_FreeImage_PluginXPM.cpp33
-rw-r--r--graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c44
-rw-r--r--graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c24
8 files changed, 16 insertions, 338 deletions
diff --git a/graphics/freeimage/Makefile b/graphics/freeimage/Makefile
index 3f843f7ba17..7beb226dc26 100644
--- a/graphics/freeimage/Makefile
+++ b/graphics/freeimage/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2019/11/02 22:37:56 rillig Exp $
+# $NetBSD: Makefile,v 1.9 2020/01/11 14:40:44 nia Exp $
-DISTNAME= FreeImage3170
-PKGNAME= freeimage-3.17.0
-PKGREVISION= 3
+DISTNAME= FreeImage3180
+PKGNAME= freeimage-3.18.0
CATEGORIES= devel graphics
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=freeimage/}
EXTRACT_SUFX= .zip
diff --git a/graphics/freeimage/distinfo b/graphics/freeimage/distinfo
index 0b51125d074..f9d3ac0e562 100644
--- a/graphics/freeimage/distinfo
+++ b/graphics/freeimage/distinfo
@@ -1,13 +1,9 @@
-$NetBSD: distinfo,v 1.6 2017/12/26 11:55:01 he Exp $
+$NetBSD: distinfo,v 1.7 2020/01/11 14:40:44 nia Exp $
-SHA1 (FreeImage3170.zip) = 6752c83798c2f81dee71a2e8bb11657068672669
-RMD160 (FreeImage3170.zip) = c4e87846098327ee346c49ae81b6036f6d9ab36d
-SHA512 (FreeImage3170.zip) = 703c2626c0bcfe73eb40d720f45745208ca9650a7730759680a2b38ad3f6c719a43008477032bc70b76a95761f7d4b6f901b961359d36b54ace906dd78fb391b
-Size (FreeImage3170.zip) = 7020636 bytes
-SHA1 (patch-Makefile) = 196331f954913d5b49ae1e2464fb356a26212168
-SHA1 (patch-Makefile.fip) = c12dd636f83f774a11c91c4e3373176fd27e562d
-SHA1 (patch-Source_FreeImage_PluginPCX.cpp) = 26853626d1dc6a52804f946fd0576269de380512
-SHA1 (patch-Source_FreeImage_PluginXPM.cpp) = eac7be24c3d64593feebdb548df8a404db66c113
+SHA1 (FreeImage3180.zip) = 38daa9d8f1bca2330a2eaa42ec66fbe6ede7dce9
+RMD160 (FreeImage3180.zip) = b791715fccf49355a3cb27b6250d8ed809c2454e
+SHA512 (FreeImage3180.zip) = 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818
+Size (FreeImage3180.zip) = 7415716 bytes
+SHA1 (patch-Makefile) = d453337cb2a34f4480d1bd3c2115cb93715170b8
+SHA1 (patch-Makefile.fip) = 466b82e70d06f9552a73d86a742aa1bd3450f881
SHA1 (patch-Source_LibOpenJPEG_opj__malloc.h) = 7e8b65d17cf1f0ed295964d477b96acac56bd927
-SHA1 (patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c) = 9725fa20d545e6482f4396487b70c104ddb37ce6
-SHA1 (patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c) = bd569e2b2fa7b79a3651f53352fc8e5d26d0b2d3
diff --git a/graphics/freeimage/patches/patch-Makefile b/graphics/freeimage/patches/patch-Makefile
index 7d67771d43c..c0469f8b8b8 100644
--- a/graphics/freeimage/patches/patch-Makefile
+++ b/graphics/freeimage/patches/patch-Makefile
@@ -1,5 +1,7 @@
-$NetBSD: patch-Makefile,v 1.2 2017/07/08 08:08:25 nros Exp $
+$NetBSD: patch-Makefile,v 1.3 2020/01/11 14:40:44 nia Exp $
+
* use c++ for linking instead of linking with stdc++
+
--- Makefile.gnu.orig 2015-03-08 17:04:00.000000000 +0000
+++ Makefile.gnu
@@ -5,8 +5,8 @@ include Makefile.srcs
diff --git a/graphics/freeimage/patches/patch-Makefile.fip b/graphics/freeimage/patches/patch-Makefile.fip
index a1d8f0a24ae..3b830b85bd0 100644
--- a/graphics/freeimage/patches/patch-Makefile.fip
+++ b/graphics/freeimage/patches/patch-Makefile.fip
@@ -1,5 +1,7 @@
-$NetBSD: patch-Makefile.fip,v 1.2 2017/07/08 08:08:25 nros Exp $
+$NetBSD: patch-Makefile.fip,v 1.3 2020/01/11 14:40:44 nia Exp $
+
* use c++ for linking instead of linking with stdc++
+
--- Makefile.fip.orig 2015-03-08 17:03:56.000000000 +0000
+++ Makefile.fip
@@ -5,8 +5,8 @@ include fipMakefile.srcs
diff --git a/graphics/freeimage/patches/patch-Source_FreeImage_PluginPCX.cpp b/graphics/freeimage/patches/patch-Source_FreeImage_PluginPCX.cpp
deleted file mode 100644
index 54161d7067f..00000000000
--- a/graphics/freeimage/patches/patch-Source_FreeImage_PluginPCX.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-$NetBSD: patch-Source_FreeImage_PluginPCX.cpp,v 1.1 2017/02/20 08:00:42 snj Exp $
-
-Fix CVE-2015-0852.
-
-http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?r1=1.17&r2=1.18&pathrev=MAIN
-
---- Source/FreeImage/PluginPCX.cpp.orig 2015-03-02 02:07:08.000000000 -0800
-+++ Source/FreeImage/PluginPCX.cpp 2017-02-19 23:39:07.000000000 -0800
-@@ -30,7 +30,7 @@
- // Constants + headers
- // ----------------------------------------------------------
-
--#define IO_BUF_SIZE 2048
-+#define PCX_IO_BUF_SIZE 2048
-
- // ----------------------------------------------------------
-
-@@ -120,17 +120,17 @@ readline(FreeImageIO &io, fi_handle hand
-
- while (length--) {
- if (count == 0) {
-- if (*ReadPos >= IO_BUF_SIZE - 1 ) {
-- if (*ReadPos == IO_BUF_SIZE - 1) {
-+ if (*ReadPos >= PCX_IO_BUF_SIZE - 1 ) {
-+ if (*ReadPos == PCX_IO_BUF_SIZE - 1) {
- // we still have one BYTE, copy it to the start pos
-
-- *ReadBuf = ReadBuf[IO_BUF_SIZE - 1];
-+ *ReadBuf = ReadBuf[PCX_IO_BUF_SIZE - 1];
-
-- io.read_proc(ReadBuf + 1, 1, IO_BUF_SIZE - 1, handle);
-+ io.read_proc(ReadBuf + 1, 1, PCX_IO_BUF_SIZE - 1, handle);
- } else {
- // read the complete buffer
-
-- io.read_proc(ReadBuf, 1, IO_BUF_SIZE, handle);
-+ io.read_proc(ReadBuf, 1, PCX_IO_BUF_SIZE, handle);
- }
-
- *ReadPos = 0;
-@@ -346,19 +346,9 @@ Load(FreeImageIO *io, fi_handle handle,
- BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS;
-
- try {
-- // check PCX identifier
--
-- long start_pos = io->tell_proc(handle);
-- BOOL validated = pcx_validate(io, handle);
-- io->seek_proc(handle, start_pos, SEEK_SET);
-- if(!validated) {
-- throw FI_MSG_ERROR_MAGIC_NUMBER;
-- }
--
-- // process the header
--
- PCXHEADER header;
-
-+ // process the header
- if(io->read_proc(&header, sizeof(PCXHEADER), 1, handle) != 1) {
- throw FI_MSG_ERROR_PARSING;
- }
-@@ -366,20 +356,38 @@ Load(FreeImageIO *io, fi_handle handle,
- SwapHeader(&header);
- #endif
-
-- // allocate a new DIB
-+ // process the window
-+ const WORD *window = header.window; // left, upper, right,lower pixel coord.
-+ const int left = window[0];
-+ const int top = window[1];
-+ const int right = window[2];
-+ const int bottom = window[3];
-
-- unsigned width = header.window[2] - header.window[0] + 1;
-- unsigned height = header.window[3] - header.window[1] + 1;
-- unsigned bitcount = header.bpp * header.planes;
-+ // check image size
-+ if((left >= right) || (top >= bottom)) {
-+ throw FI_MSG_ERROR_PARSING;
-+ }
-
-- if (bitcount == 24) {
-- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
-- } else {
-- dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
-+ const unsigned width = right - left + 1;
-+ const unsigned height = bottom - top + 1;
-+ const unsigned bitcount = header.bpp * header.planes;
-+
-+ // allocate a new dib
-+ switch(bitcount) {
-+ case 1:
-+ case 4:
-+ case 8:
-+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
-+ break;
-+ case 24:
-+ dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
-+ break;
-+ default:
-+ throw FI_MSG_ERROR_DIB_MEMORY;
-+ break;
- }
-
- // if the dib couldn't be allocated, throw an error
--
- if (!dib) {
- throw FI_MSG_ERROR_DIB_MEMORY;
- }
-@@ -426,19 +434,23 @@ Load(FreeImageIO *io, fi_handle handle,
-
- if (palette_id == 0x0C) {
- BYTE *cmap = (BYTE*)malloc(768 * sizeof(BYTE));
-- io->read_proc(cmap, 768, 1, handle);
-
-- pal = FreeImage_GetPalette(dib);
-- BYTE *pColormap = &cmap[0];
-+ if(cmap) {
-+ io->read_proc(cmap, 768, 1, handle);
-
-- for(int i = 0; i < 256; i++) {
-- pal[i].rgbRed = pColormap[0];
-- pal[i].rgbGreen = pColormap[1];
-- pal[i].rgbBlue = pColormap[2];
-- pColormap += 3;
-+ pal = FreeImage_GetPalette(dib);
-+ BYTE *pColormap = &cmap[0];
-+
-+ for(int i = 0; i < 256; i++) {
-+ pal[i].rgbRed = pColormap[0];
-+ pal[i].rgbGreen = pColormap[1];
-+ pal[i].rgbBlue = pColormap[2];
-+ pColormap += 3;
-+ }
-+
-+ free(cmap);
- }
-
-- free(cmap);
- }
-
- // wrong palette ID, perhaps a gray scale is needed ?
-@@ -463,12 +475,12 @@ Load(FreeImageIO *io, fi_handle handle,
- return dib;
- }
-
-- // calculate the line length for the PCX and the DIB
-+ // calculate the line length for the PCX and the dib
-
- // length of raster line in bytes
-- unsigned linelength = header.bytes_per_line * header.planes;
-- // length of DIB line (rounded to DWORD) in bytes
-- unsigned pitch = FreeImage_GetPitch(dib);
-+ const unsigned linelength = header.bytes_per_line * header.planes;
-+ // length of dib line (rounded to DWORD) in bytes
-+ const unsigned pitch = FreeImage_GetPitch(dib);
-
- // run-length encoding ?
-
-@@ -478,14 +490,18 @@ Load(FreeImageIO *io, fi_handle handle,
- // ---------------
-
- line = (BYTE*)malloc(linelength * sizeof(BYTE));
-- if(!line) throw FI_MSG_ERROR_MEMORY;
-+ if(!line) {
-+ throw FI_MSG_ERROR_MEMORY;
-+ }
-
-- ReadBuf = (BYTE*)malloc(IO_BUF_SIZE * sizeof(BYTE));
-- if(!ReadBuf) throw FI_MSG_ERROR_MEMORY;
-+ ReadBuf = (BYTE*)malloc(PCX_IO_BUF_SIZE * sizeof(BYTE));
-+ if(!ReadBuf) {
-+ throw FI_MSG_ERROR_MEMORY;
-+ }
-
- bits = FreeImage_GetScanLine(dib, height - 1);
-
-- int ReadPos = IO_BUF_SIZE;
-+ int ReadPos = PCX_IO_BUF_SIZE;
-
- if ((header.planes == 1) && ((header.bpp == 1) || (header.bpp == 8))) {
- BYTE skip;
-@@ -497,7 +513,7 @@ Load(FreeImageIO *io, fi_handle handle,
- // skip trailing garbage at the end of the scanline
-
- for (unsigned count = written; count < linelength; count++) {
-- if (ReadPos < IO_BUF_SIZE) {
-+ if (ReadPos < PCX_IO_BUF_SIZE) {
- ReadPos++;
- } else {
- io->read_proc(&skip, sizeof(BYTE), 1, handle);
-@@ -513,7 +529,9 @@ Load(FreeImageIO *io, fi_handle handle,
- unsigned x, y, written;
-
- buffer = (BYTE*)malloc(width * sizeof(BYTE));
-- if(!buffer) throw FI_MSG_ERROR_MEMORY;
-+ if(!buffer) {
-+ throw FI_MSG_ERROR_MEMORY;
-+ }
-
- for (y = 0; y < height; y++) {
- written = readline(*io, handle, line, linelength, bIsRLE, ReadBuf, &ReadPos);
-@@ -532,7 +550,7 @@ Load(FreeImageIO *io, fi_handle handle,
- }
- }
-
-- // then write the DIB row
-+ // then write the dib row
-
- for (x = 0; x < width / 2; x++) {
- bits[x] = (buffer[2*x] << 4) | buffer[2*x+1];
-@@ -541,7 +559,7 @@ Load(FreeImageIO *io, fi_handle handle,
- // skip trailing garbage at the end of the scanline
-
- for (unsigned count = written; count < linelength; count++) {
-- if (ReadPos < IO_BUF_SIZE) {
-+ if (ReadPos < PCX_IO_BUF_SIZE) {
- ReadPos++;
- } else {
- io->read_proc(&skip, sizeof(BYTE), 1, handle);
diff --git a/graphics/freeimage/patches/patch-Source_FreeImage_PluginXPM.cpp b/graphics/freeimage/patches/patch-Source_FreeImage_PluginXPM.cpp
deleted file mode 100644
index fcbf627d844..00000000000
--- a/graphics/freeimage/patches/patch-Source_FreeImage_PluginXPM.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-Source_FreeImage_PluginXPM.cpp,v 1.1 2017/02/20 08:00:42 snj Exp $
-
-Fix CVE-2016-5684.
-
-http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginXPM.cpp?r1=1.17&r2=1.18
-
-and
-
-http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginXPM.cpp?r1=1.18&r2=1.19
-
---- Source/FreeImage/PluginXPM.cpp.orig 2015-03-02 02:07:08.000000000 -0800
-+++ Source/FreeImage/PluginXPM.cpp 2017-02-19 11:37:34.000000000 -0800
-@@ -181,6 +181,11 @@ Load(FreeImageIO *io, fi_handle handle,
- }
- free(str);
-
-+ // check info string
-+ if((width <= 0) || (height <= 0) || (colors <= 0) || (cpp <= 0)) {
-+ throw "Improperly formed info string";
-+ }
-+
- if (colors > 256) {
- dib = FreeImage_AllocateHeader(header_only, width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
- } else {
-@@ -193,7 +198,7 @@ Load(FreeImageIO *io, fi_handle handle,
- FILE_RGBA rgba;
-
- str = ReadString(io, handle);
-- if(!str)
-+ if(!str || (strlen(str) < (size_t)cpp))
- throw "Error reading color strings";
-
- std::string chrs(str,cpp); //create a string for the color chars using the first cpp chars
diff --git a/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c b/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c
deleted file mode 100644
index 1004a194f71..00000000000
--- a/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-Source_LibWebP_src_dsp_dsp.upsampling_mips_dsp_r2.c,v 1.1 2017/12/26 11:55:01 he Exp $
-
-Adapt to newer C++ where R"some string" has new meaning.
-
---- Source/LibWebP/./src/dsp/dsp.upsampling_mips_dsp_r2.c.orig 2015-02-20 02:34:36.000000000 +0000
-+++ Source/LibWebP/./src/dsp/dsp.upsampling_mips_dsp_r2.c
-@@ -21,29 +21,29 @@
-
- #if !defined(WEBP_YUV_USE_TABLE)
-
--#define YUV_TO_RGB(Y, U, V, R, G, B) do { \
-+#define YUV_TO_RGB(Y, U, V, Red, G, B) do { \
- const int t1 = kYScale * Y; \
- const int t2 = kVToG * V; \
-- R = kVToR * V; \
-+ Red = kVToR * V; \
- G = kUToG * U; \
- B = kUToB * U; \
-- R = t1 + R; \
-+ Red = t1 + Red; \
- G = t1 - G; \
- B = t1 + B; \
-- R = R + kRCst; \
-+ Red = Red + kRCst; \
- G = G - t2 + kGCst; \
- B = B + kBCst; \
- __asm__ volatile ( \
-- "shll_s.w %["#R"], %["#R"], 9 \n\t" \
-+ "shll_s.w %["#Red"], %["#Red"], 9 \n\t" \
- "shll_s.w %["#G"], %["#G"], 9 \n\t" \
- "shll_s.w %["#B"], %["#B"], 9 \n\t" \
-- "precrqu_s.qb.ph %["#R"], %["#R"], $zero \n\t" \
-+ "precrqu_s.qb.ph %["#Red"], %["#Red"], $zero \n\t" \
- "precrqu_s.qb.ph %["#G"], %["#G"], $zero \n\t" \
- "precrqu_s.qb.ph %["#B"], %["#B"], $zero \n\t" \
-- "srl %["#R"], %["#R"], 24 \n\t" \
-+ "srl %["#Red"], %["#Red"], 24 \n\t" \
- "srl %["#G"], %["#G"], 24 \n\t" \
- "srl %["#B"], %["#B"], 24 \n\t" \
-- : [R]"+r"(R), [G]"+r"(G), [B]"+r"(B) \
-+ : [Red]"+r"(Red), [G]"+r"(G), [B]"+r"(B) \
- : \
- ); \
- } while (0)
diff --git a/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c b/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c
deleted file mode 100644
index b85a53200ab..00000000000
--- a/graphics/freeimage/patches/patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-Source_LibWebP_src_dsp_dsp.yuv_mips_dsp_r2.c,v 1.1 2017/12/26 11:55:01 he Exp $
-
-Adapt to newer C++ where R"some string" has new meaning.
-
---- Source/LibWebP/./src/dsp/dsp.yuv_mips_dsp_r2.c.orig 2015-02-20 02:34:38.000000000 +0000
-+++ Source/LibWebP/./src/dsp/dsp.yuv_mips_dsp_r2.c
-@@ -35,7 +35,7 @@
- "addu %[temp2], %[temp2], %[temp3] \n\t" \
- "addu %[temp4], %[temp4], %[t_con_8] \n\t" \
-
--#define ROW_FUNC_PART_2(R, G, B, K) \
-+#define ROW_FUNC_PART_2(Red, G, B, K) \
- "addu %[temp5], %[temp0], %[temp1] \n\t" \
- "subu %[temp6], %[temp0], %[temp2] \n\t" \
- "addu %[temp7], %[temp0], %[temp4] \n\t" \
-@@ -54,7 +54,7 @@
- "srl %[temp5], %[temp5], 24 \n\t" \
- "srl %[temp6], %[temp6], 24 \n\t" \
- "srl %[temp7], %[temp7], 24 \n\t" \
-- "sb %[temp5], "#R"(%[dst]) \n\t" \
-+ "sb %[temp5], "#Red"(%[dst]) \n\t" \
- "sb %[temp6], "#G"(%[dst]) \n\t" \
- "sb %[temp7], "#B"(%[dst]) \n\t" \
-