Index: head/graphics/exact-image/Makefile =================================================================== --- head/graphics/exact-image/Makefile (revision 500747) +++ head/graphics/exact-image/Makefile (revision 500748) @@ -1,86 +1,78 @@ # Created by: Andrew Pantyukhin # $FreeBSD$ PORTNAME= exact-image -PORTVERSION= 0.9.1 -PORTREVISION= 2 +PORTVERSION= 0.9.2 CATEGORIES= graphics perl5 python MASTER_SITES= https://dl.exactcode.de/oss/exact-image/ MAINTAINER= ports@FreeBSD.org COMMENT= Fast image processing library LICENSE= GPLv2 BROKEN_armv6= fails to configure: C++ compiler is not installed or does not work correctly BROKEN_armv7= fails to configure: C++ compiler is not installed or does not work correctly -BROKEN_i386= call to 'abs' is ambiguous BUILD_DEPENDS= swig3.0:devel/swig30 LIB_DEPENDS= libagg.so:graphics/agg \ libtiff.so:graphics/tiff \ libpng.so:graphics/png \ libgif.so:graphics/giflib \ libjasper.so:graphics/jasper \ libIlmImf.so:graphics/openexr \ liblcms.so:graphics/lcms \ libfreetype.so:print/freetype2 \ libexpat.so:textproc/expat2 #hack to get custom exactcode configure script to enable tiff support with #broken headers on c++ in base system: CPPFLAGS+= -fpermissive -I${LOCALBASE}/include USES= gmake jpeg perl5 pkgconfig python:2.7 tar:bzip2 -USE_CXXSTD= c++98 +USE_CXXSTD= c++03 USE_XORG= x11 HAS_CONFIGURE= yes INSTALL_WRKSRC= ${WRKSRC}/objdir BINS= bardecode econvert edentify empty-page hocr2pdf optimize2bw PLIST_FILES= ${BINS:S|^|bin/|} \ %%SITE_PERL%%/ExactImage.so \ %%SITE_PERL%%/ExactImage.pm \ %%PYTHON_SITELIBDIR%%/ExactImage.py \ %%PYTHON_SITELIBDIR%%/_ExactImage.so BINARY_ALIAS= swig=swig3.0 -post-extract: - @${RM} -r ${WRKSRC}/agg-2.4/ - post-patch: @${REINPLACE_CMD} -e '1s|/.*|/bin/sh|;s|/usr/local|${LOCALBASE}|;\ - s|libungif|giflib|; s|LIBUNGIF|GIFLIB|; \ /parse_options/d;s| cc | ${CC} |;s| c++ | ${CXX} |;\ s|python -V|${PYTHON_CMD} -V|;\ /PYTHONINCS/s|=.*$$|=-I${PYTHON_INCLUDEDIR}|; \ s|pkg-config EVAS atleast 0.9.9|pkg-config EVAS equals 1.7.9|; \ s|php -config PHP atleast 5.2.0|php -config PHP atleast 15.2.0|' \ ${WRKSRC}/configure @${REINPLACE_CMD} -e '/^Q =/d;s|$$[(]COMPILE.cc[)]|${CXX} $${CPPFLAGS} -c|;\ s|$$[(]CXX[)]|${CXX}|;s|$$[(]COMPILE.c[)]|${CC} $${CPPFLAGS} -c|'\ ${WRKSRC}/build/bottom.make - @${REINPLACE_CMD} -e '/^CFLAGS =/d;/^CXXFLAGS =/d;/march=/d;\ - /mtune=/d;/call cc-option/d;' ${WRKSRC}/Makefile - @${REINPLACE_CMD} -e 's|-lungif|-lgif|; s|LIBUNGIF|GIFLIB|' \ - ${WRKSRC}/codecs/Makefile @${REINPLACE_CMD} -e '/CFLAGS=/s|".*"|"${CFLAGS} -I${LOCALBASE}/include"|;\ /LIBS=/s|".*"|"-L${LOCALBASE}/lib -lX11"|' ${WRKSRC}/config/pkgcheck-x11.c @${REINPLACE_CMD} -e 's|$$prg|$$prg ${CPPFLAGS} -I${LOCALBASE}/include|;\ s|/usr/local|${PREFIX}|;/^var_remove/,/^}/d;/^parse_options/,/^}/d; \ s| ++errors | errors+=1 |g' \ ${WRKSRC}/config/functions - @${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|' ${WRKSRC}/lib/vectorial.cc \ + @${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|' \ + ${WRKSRC}/image/vectorial.cc \ ${WRKSRC}/edisplay/edisplay.cc + @${REINPLACE_CMD} -e 's| = {}||g' ${WRKSRC}/image/Colorspace.cc do-install: @cd ${INSTALL_WRKSRC}/&&for i in ${BINS};do\ ${INSTALL_PROGRAM} */$$i ${STAGEDIR}${PREFIX}/bin/;done @cd ${INSTALL_WRKSRC}/api/perl&&\ ${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}&&\ ${INSTALL_PROGRAM} ExactImage.so ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/&&\ ${INSTALL_DATA} ExactImage.pm ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/ @cd ${INSTALL_WRKSRC}/api/python&&\ ${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/&&\ ${INSTALL_SCRIPT} ExactImage.py ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/&&\ ${INSTALL_PROGRAM} _ExactImage.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/ .include Index: head/graphics/exact-image/distinfo =================================================================== --- head/graphics/exact-image/distinfo (revision 500747) +++ head/graphics/exact-image/distinfo (revision 500748) @@ -1,2 +1,3 @@ -SHA256 (exact-image-0.9.1.tar.bz2) = 79e6a58522897f9740aa3b5a337f63ad1e0361a772141b24aaff2e31264ece7d -SIZE (exact-image-0.9.1.tar.bz2) = 299565 +TIMESTAMP = 1480938306 +SHA256 (exact-image-0.9.2.tar.bz2) = 665b205740b17b4162fae73aa36eb7046f28bb216d612461ca0499ff47a566ba +SIZE (exact-image-0.9.2.tar.bz2) = 312995 Index: head/graphics/exact-image/files/patch-frontends-bardecode.cc =================================================================== --- head/graphics/exact-image/files/patch-frontends-bardecode.cc (revision 500747) +++ head/graphics/exact-image/files/patch-frontends-bardecode.cc (nonexistent) @@ -1,11 +0,0 @@ ---- frontends/bardecode.cc.orig 2010-06-18 18:02:15.000000000 +0400 -+++ frontends/bardecode.cc 2014-01-13 07:31:33.549465639 +0400 -@@ -145,7 +145,7 @@ - } - } - -- for (std::map::const_iterator it = codes.begin(); -+ for (std::map::const_iterator it = codes.begin(); - it != codes.end(); - ++it) { - if (it->first.type&(ean|code128|gs1_128) || it->second > 1) Property changes on: head/graphics/exact-image/files/patch-frontends-bardecode.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-libpng14 =================================================================== --- head/graphics/exact-image/files/patch-libpng14 (revision 500747) +++ head/graphics/exact-image/files/patch-libpng14 (nonexistent) @@ -1,69 +0,0 @@ ---- codecs/png.cc -+++ codecs/png.cc -@@ -71,7 +71,7 @@ - /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { -- png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, NULL, NULL); - return 0; - } - -@@ -82,7 +82,7 @@ - - if (setjmp(png_jmpbuf(png_ptr))) { - /* Free all of the memory associated with the png_ptr and info_ptr */ -- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - /* If we get here, we had a problem reading the file */ - return 0; - } -@@ -99,7 +99,7 @@ - png_read_info (png_ptr, info_ptr); - - png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, -- &interlace_type, int_p_NULL, int_p_NULL); -+ &interlace_type, NULL, NULL); - - image.w = width; - image.h = height; -@@ -132,7 +132,7 @@ - #if 0 // no longer needed - /* Expand grayscale images to the full 8 bits from 2, or 4 bits/pixel */ - if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth > 1 && bit_depth < 8) { -- png_set_gray_1_2_4_to_8(png_ptr); -+ png_set_expand_gray_1_2_4_to_8(png_ptr); - image.bps = 8; - } - #endif -@@ -196,11 +196,11 @@ - for (int pass = 0; pass < number_passes; ++pass) - for (unsigned int y = 0; y < height; ++y) { - row_pointers[0] = image.getRawData() + y * stride; -- png_read_rows(png_ptr, row_pointers, png_bytepp_NULL, 1); -+ png_read_rows(png_ptr, row_pointers, NULL, 1); - } - - /* clean up after the read, and free any memory allocated - REQUIRED */ -- png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); -+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - - /* that's it */ - return true; -@@ -224,7 +224,7 @@ - /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { -- png_destroy_write_struct(&png_ptr, png_infopp_NULL); -+ png_destroy_write_struct(&png_ptr, NULL); - return false; - } - -@@ -244,7 +244,6 @@ - else if (quality > Z_BEST_COMPRESSION) quality = Z_BEST_COMPRESSION; - png_set_compression_level(png_ptr, quality); - -- png_info_init (info_ptr); - - /* Set up our STL stream output control */ - png_set_write_fn (png_ptr, stream, &stdstream_write_data, &stdstream_flush_data); Property changes on: head/graphics/exact-image/files/patch-libpng14 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-libpng15 =================================================================== --- head/graphics/exact-image/files/patch-libpng15 (revision 500747) +++ head/graphics/exact-image/files/patch-libpng15 (nonexistent) @@ -1,34 +0,0 @@ ---- codecs/png.cc -+++ codecs/png.cc -@@ -16,6 +16,7 @@ - */ - - #include -+#include - #include - - #include -@@ -104,7 +105,7 @@ - image.w = width; - image.h = height; - image.bps = bit_depth; -- image.spp = info_ptr->channels; -+ image.spp = png_get_channels(png_ptr, info_ptr); - - png_uint_32 res_x, res_y; - res_x = png_get_x_pixels_per_meter(png_ptr, info_ptr); -@@ -120,10 +121,13 @@ - // png_set_packswap(png_ptr); - - /* Expand paletted colors into true RGB triplets */ -+ -+ int num_trans; -+ - if (color_type == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); - image.bps = 8; -- if (info_ptr->num_trans) -+ if (num_trans) - image.spp = 4; - else - image.spp = 3; Property changes on: head/graphics/exact-image/files/patch-libpng15 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-lib__ContourUtility.cc =================================================================== --- head/graphics/exact-image/files/patch-lib__ContourUtility.cc (revision 500747) +++ head/graphics/exact-image/files/patch-lib__ContourUtility.cc (nonexistent) @@ -1,13 +0,0 @@ ---- lib/ContourUtility.cc.orig 2009-07-10 10:25:43.000000000 -0400 -+++ lib/ContourUtility.cc 2009-07-10 10:26:31.000000000 -0400 -@@ -1,9 +1,9 @@ --#include "ContourUtility.hh" - #include - #include - //#include - #include - #include -+#include "ContourUtility.hh" - - void CenterAndReduce(const Contours::Contour& source, - Contours::Contour& dest, Property changes on: head/graphics/exact-image/files/patch-lib__ContourUtility.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-codecs__bmp.cc =================================================================== --- head/graphics/exact-image/files/patch-codecs__bmp.cc (revision 500747) +++ head/graphics/exact-image/files/patch-codecs__bmp.cc (nonexistent) @@ -1,26 +0,0 @@ ---- codecs/bmp.cc.orig 2009-04-27 13:54:29.000000000 -0400 -+++ codecs/bmp.cc 2010-01-17 00:32:01.000000000 -0500 -@@ -441,6 +441,8 @@ - uint8_t* row_data = (uint8_t*) malloc (file_stride); - if (!data || !row_data) { - std::cerr << "Can't allocate space for image buffer\n"; -+ free(data); -+ free(row_data); - goto bad1; - } - -@@ -522,6 +524,7 @@ - comprbuf = (uint8_t *) malloc( compr_size ); - if (!comprbuf) { - std::cerr << "Can't allocate space for compressed scanline buffer\n"; -+ free(comprbuf); - goto bad1; - } - uncomprbuf = (uint8_t *) malloc( uncompr_size ); -@@ -593,6 +596,7 @@ - data = (uint8_t *) malloc( uncompr_size ); - if (!data) { - std::cerr << "Can't allocate space for final uncompressed scanline buffer\n"; -+ free(data); - goto bad1; - } Property changes on: head/graphics/exact-image/files/patch-codecs__bmp.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-lib__ContourMatching.cc =================================================================== --- head/graphics/exact-image/files/patch-lib__ContourMatching.cc (revision 500747) +++ head/graphics/exact-image/files/patch-lib__ContourMatching.cc (nonexistent) @@ -1,10 +0,0 @@ ---- lib/ContourMatching.cc.orig 2009-07-10 11:19:11.000000000 -0400 -+++ lib/ContourMatching.cc 2009-07-10 11:20:05.000000000 -0400 -@@ -1,6 +1,7 @@ - #include - #include - #include -+#include - - #include "ContourMatching.hh" - Property changes on: head/graphics/exact-image/files/patch-lib__ContourMatching.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-codecs__xpm.cc =================================================================== --- head/graphics/exact-image/files/patch-codecs__xpm.cc (revision 500747) +++ head/graphics/exact-image/files/patch-codecs__xpm.cc (nonexistent) @@ -1,19 +0,0 @@ ---- codecs/xpm.cc.orig 2009-07-02 18:34:51.000000000 -0400 -+++ codecs/xpm.cc 2009-07-02 18:48:45.000000000 -0400 -@@ -131,6 +131,7 @@ - // Type: c -> colour, m -> monochrome, g -> grayscale, and s -> symbolic - if (type != "c") { - std::cerr << "XPM color type: " << type << " not yet implemented." << std::endl; -+ delete[] rmap; delete[] gmap; delete[] bmap; - return false; - } - -@@ -197,7 +198,7 @@ - } - - colorspace_de_palette (image, colors, rmap, gmap, bmap); -- delete (rmap); delete (gmap); delete (bmap); -+ delete[] rmap; delete[] gmap; delete[] bmap; - rmap = gmap = bmap = 0; - - return true; Property changes on: head/graphics/exact-image/files/patch-codecs__xpm.cc ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-lib__ImageIterator2.hh =================================================================== --- head/graphics/exact-image/files/patch-lib__ImageIterator2.hh (revision 500747) +++ head/graphics/exact-image/files/patch-lib__ImageIterator2.hh (nonexistent) @@ -1,24 +0,0 @@ ---- lib/ImageIterator2.hh.orig 2011-03-16 13:35:37.000000000 -0400 -+++ lib/ImageIterator2.hh 2011-03-16 13:36:39.000000000 -0400 -@@ -358,9 +358,9 @@ - } - - accu& abs() { -- v[0] = std::abs(v[0]); -- v[1] = std::abs(v[1]); -- v[2] = std::abs(v[2]); -+ v[0] = std::labs(v[0]); -+ v[1] = std::labs(v[1]); -+ v[2] = std::labs(v[2]); - return *this; - } - -@@ -639,7 +639,7 @@ - } - - accu& abs() { -- v[0] = std::abs(v[0]); -+ v[0] = std::labs(v[0]); - return *this; - } - Property changes on: head/graphics/exact-image/files/patch-lib__ImageIterator2.hh ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-bardecode__code128.hh =================================================================== --- head/graphics/exact-image/files/patch-bardecode__code128.hh (revision 500747) +++ head/graphics/exact-image/files/patch-bardecode__code128.hh (nonexistent) @@ -1,11 +0,0 @@ ---- bardecode/code128.hh.orig 2010-01-16 23:58:07.000000000 -0500 -+++ bardecode/code128.hh 2010-01-16 23:38:25.000000000 -0500 -@@ -235,7 +235,7 @@ - switch (code_set) { - case code_set_c: - if (c < 100) { -- char str[2]; -+ char str[3]; - sprintf(str,"%02d",c); - return std::string(str); - } else { Property changes on: head/graphics/exact-image/files/patch-bardecode__code128.hh ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-Makefile =================================================================== --- head/graphics/exact-image/files/patch-Makefile (nonexistent) +++ head/graphics/exact-image/files/patch-Makefile (revision 500748) @@ -0,0 +1,32 @@ +--- Makefile.orig 2016-06-18 19:35:35 UTC ++++ Makefile +@@ -7,10 +7,10 @@ include utility/Makefile + X_BUILD_IMPLICIT=1 + + # -s silcently corrupts binaries on OS X, sigh -ReneR +-CFLAGS := -Wall -O2 # -O1 -ggdb # -fsanitize=address -fsanitize=undefined ++CFLAGS += -Wall # -O2 -O1 -ggdb # -fsanitize=address -fsanitize=undefined + + # for config.h +-CPPFLAGS += -I . ++CPPFLAGS += -I . -D__LONG_LONG_SUPPORTED + + # -frename-registers and -funroll-loops brings a lot performance on + # my AMD Turion - about 20% time decrease (though it is included in -funroll-loops anyway) !!! +@@ -28,6 +28,7 @@ endif + # TODO: improve to match i[3456]86 + ifneq "$(X_ARCH)" "i686" + CFLAGS += -fPIC ++CXXFLAGS += -fPIC + endif + + ifeq "$(X_ARCH)" "sparc64" +@@ -48,7 +49,7 @@ CFLAGS += $(call cc-option,-ftree-vectorize,) + # we have some unimplemented colorspaces in the Image::iterator :-( + CFLAGS += $(call cc-option,-Wno-switch -Wno-switch-enum,) + +-CXXFLAGS := $(CFLAGS) -Wno-sign-compare ++CXXFLAGS += -Wall -Wno-sign-compare + + ifeq "$(STATIC)" "1" + X_EXEFLAGS += -static Property changes on: head/graphics/exact-image/files/patch-Makefile ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/exact-image/files/patch-codecs__gif.cc =================================================================== --- head/graphics/exact-image/files/patch-codecs__gif.cc (revision 500747) +++ head/graphics/exact-image/files/patch-codecs__gif.cc (revision 500748) @@ -1,189 +1,177 @@ ---- codecs/gif.cc.orig 2010-03-03 21:04:44 UTC +--- codecs/gif.cc.orig 2015-03-28 15:35:58 UTC +++ codecs/gif.cc @@ -22,6 +22,24 @@ #include +#if GIFLIB_MAJOR >= 5 +void ExactImagePrintGifError(int ErrorCode) +#else +void ExactImagePrintGifError(void) +#endif +{ +#if GIFLIB_MAJOR >= 5 + const char *Err = GifErrorString(ErrorCode); +#else + char *Err = GifErrorString(); + int ErrorCode = GifError(); +#endif + if (Err != NULL) + std::cerr << "\nGIF-LIB error: " << Err << std::endl; + else + std::cerr << "\nGIF-LIB undefined error " << ErrorCode << "." << std::endl; +} + /* The way Interlaced image should. */ static const int InterlacedOffset[] = { 0, 4, 2, 1 }; -@@ -60,9 +78,13 @@ int GIFCodec::readImage (std::istream* s - ColorMapObject *ColorMap = NULL; - int ExtCode; +@@ -60,9 +78,13 @@ int GIFCodec::readImage (std::istream* stream, Image& + ColorMapObject *ColorMap = 0; + int GifError, ExtCode; +#if GIFLIB_MAJOR >= 5 -+ if ((GifFile = DGifOpen (stream, &GIFInputFunc, NULL)) == NULL) + if ((GifFile = DGifOpen (stream, &GIFInputFunc, &GifError)) == 0) +#else - if ((GifFile = DGifOpen (stream, &GIFInputFunc)) == NULL) ++ if ((GifFile = DGifOpen (stream, &GIFInputFunc)) == 0) +#endif { -- PrintGifError(); +- //PrintGifError(); + std::cerr << "\nGIF-LIB error: can't open GIF file" << std::endl; return false; } -@@ -74,7 +96,11 @@ int GIFCodec::readImage (std::istream* s +@@ -74,7 +96,11 @@ int GIFCodec::readImage (std::istream* stream, Image& /* Scan the content of the GIF file and load the image(s) in: */ do { if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } -@@ -83,7 +109,11 @@ int GIFCodec::readImage (std::istream* s +@@ -83,7 +109,11 @@ int GIFCodec::readImage (std::istream* stream, Image& switch (RecordType) { case IMAGE_DESC_RECORD_TYPE: if (DGifGetImageDesc(GifFile) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } -@@ -104,7 +134,11 @@ int GIFCodec::readImage (std::istream* s +@@ -104,7 +134,11 @@ int GIFCodec::readImage (std::istream* stream, Image& j += InterlacedJumps[i]) { if (DGifGetLine(GifFile, &image.getRawData()[j*image.stride()+Col], Width) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } } -@@ -113,7 +147,11 @@ int GIFCodec::readImage (std::istream* s +@@ -113,7 +147,11 @@ int GIFCodec::readImage (std::istream* stream, Image& for (int i = 0; i < Height; ++i) { if (DGifGetLine(GifFile, &image.getRawData()[Row++ * image.stride()+Col], Width) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } } -@@ -122,12 +160,20 @@ int GIFCodec::readImage (std::istream* s +@@ -122,12 +160,20 @@ int GIFCodec::readImage (std::istream* stream, Image& case EXTENSION_RECORD_TYPE: /* Skip any extension blocks in file: */ if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } - while (Extension != NULL) { + while (Extension != 0) { if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) { -- PrintGifError(); +- //PrintGifError(); +#if GIFLIB_MAJOR >= 5 + ExactImagePrintGifError(GifFile->Error); +#else + ExactImagePrintGifError(); +#endif return false; } } -@@ -155,7 +201,11 @@ int GIFCodec::readImage (std::istream* s +@@ -155,7 +201,11 @@ int GIFCodec::readImage (std::istream* stream, Image& // convert colormap to our 16bit "TIFF"format colorspace_de_palette (image, ColorMap->ColorCount, rmap, gmap, bmap); +#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 -+ EGifCloseFile(GifFile, NULL); + EGifCloseFile(GifFile, &GifError); +#else - EGifCloseFile(GifFile); ++ EGifCloseFile(GifFile); +#endif return true; } -@@ -166,7 +216,11 @@ bool GIFCodec::writeImage (std::ostream* - GifFileType* GifFile; +@@ -167,7 +217,11 @@ bool GIFCodec::writeImage (std::ostream* stream, Image GifByteType* Ptr; + int GifError; +#if GIFLIB_MAJOR >= 5 -+ if ((GifFile = EGifOpen (stream, &GIFOutputFunc, NULL)) == NULL) + if ((GifFile = EGifOpen(stream, &GIFOutputFunc, &GifError)) == 0) +#else - if ((GifFile = EGifOpen (stream, &GIFOutputFunc)) == NULL) ++ if ((GifFile = EGifOpen(stream, &GIFOutputFunc)) == 0) +#endif { std::cerr << "Error preparing GIF file for writing." << std::endl; return false; -@@ -175,7 +229,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -176,7 +230,11 @@ bool GIFCodec::writeImage (std::ostream* stream, Image int ColorMapSize = 256; // later use our own colormap generation +#if GIFLIB_MAJOR >= 5 -+ ColorMapObject* OutputColorMap = GifMakeMapObject(ColorMapSize, NULL); + ColorMapObject* OutputColorMap = GifMakeMapObject(ColorMapSize, 0); +#else - ColorMapObject* OutputColorMap = MakeMapObject(ColorMapSize, NULL); ++ ColorMapObject* OutputColorMap = MakeMapObject(ColorMapSize, 0); +#endif if (!OutputColorMap) return false; -@@ -203,7 +261,11 @@ bool GIFCodec::writeImage (std::ostream* +@@ -204,7 +262,11 @@ bool GIFCodec::writeImage (std::ostream* stream, Image } +#if GIFLIB_MAJOR >= 5 -+ if (GifQuantizeBuffer(image.w, image.h, &ColorMapSize, + if (GifQuantizeBuffer(image.w, image.h, &ColorMapSize, +#else - if (QuantizeBuffer(image.w, image.h, &ColorMapSize, ++ if (QuantizeBuffer(image.w, image.h, &ColorMapSize, +#endif RedBuffer, GreenBuffer, BlueBuffer, OutputBuffer, OutputColorMap->Colors) == GIF_ERROR) { return false; -@@ -215,7 +277,7 @@ bool GIFCodec::writeImage (std::ostream* - if (EGifPutScreenDesc(GifFile, image.w, image.h, - ColorMapSize, 0, OutputColorMap) == GIF_ERROR || - EGifPutImageDesc(GifFile, 0, 0, image.w, image.h, -- FALSE, NULL) == GIF_ERROR) -+ false, NULL) == GIF_ERROR) - { - std::cerr << "Error writing GIF header." << std::endl; - return false; -@@ -232,9 +294,13 @@ bool GIFCodec::writeImage (std::ostream* - } - free (OutputBuffer); +@@ -235,7 +297,11 @@ bool GIFCodec::writeImage (std::ostream* stream, Image -- delete (RedBuffer); delete (GreenBuffer); delete (BlueBuffer); -+ delete[] RedBuffer; delete[] GreenBuffer; delete[] BlueBuffer; + delete[] RedBuffer; delete[] GreenBuffer; delete[] BlueBuffer; +#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 -+ EGifCloseFile(GifFile, NULL); + EGifCloseFile(GifFile, &GifError); +#else - EGifCloseFile(GifFile); ++ EGifCloseFile(GifFile); +#endif return true; } Index: head/graphics/exact-image/files/patch-codecs_dcraw.h =================================================================== --- head/graphics/exact-image/files/patch-codecs_dcraw.h (revision 500747) +++ head/graphics/exact-image/files/patch-codecs_dcraw.h (revision 500748) @@ -1,24 +1,60 @@ ---- codecs/dcraw.h.orig 2013-10-22 14:00:07 UTC +--- codecs/dcraw.h.orig 2015-07-16 15:20:12 UTC +++ codecs/dcraw.h -@@ -775,7 +775,8 @@ struct jhead { - - int CLASS ljpeg_start (struct jhead *jh, int info_only) - { -- int c, tag, len; -+ int c,tag; -+ ushort len; - uchar data[0x10000]; - const uchar *dp; - -@@ -786,8 +787,9 @@ int CLASS ljpeg_start (struct jhead *jh, +@@ -843,8 +843,9 @@ int CLASS ljpeg_start (struct jhead *jh, int info_only do { fread (data, 2, 2, ifp); tag = data[0] << 8 | data[1]; - len = (data[2] << 8 | data[3]) - 2; - if (tag <= 0xff00) return 0; + len = (data[2] << 8 | data[3]); + if (tag <= 0xff00 || len <= 2) return 0; + len -= 2; fread (data, 1, len, ifp); switch (tag) { case 0xffc3: +@@ -4393,22 +4394,22 @@ void CLASS vng_interpolate() + -2,+0,+0,-1,0,0x06, -2,+0,+0,+0,1,0x02, -2,+0,+0,+1,0,0x03, + -2,+1,-1,+0,0,0x04, -2,+1,+0,-1,1,0x04, -2,+1,+0,+0,0,0x06, + -2,+1,+0,+1,0,0x02, -2,+2,+0,+0,1,0x04, -2,+2,+0,+1,0,0x04, +- -1,-2,-1,+0,0,0x80, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, +- -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,0x88, -1,-1,+1,-2,0,0x40, ++ -1,-2,-1,+0,0,-128, -1,-2,+0,-1,0,0x01, -1,-2,+1,-1,0,0x01, ++ -1,-2,+1,+0,1,0x01, -1,-1,-1,+1,0,-120, -1,-1,+1,-2,0,0x40, + -1,-1,+1,-1,0,0x22, -1,-1,+1,+0,0,0x33, -1,-1,+1,+1,1,0x11, + -1,+0,-1,+2,0,0x08, -1,+0,+0,-1,0,0x44, -1,+0,+0,+1,0,0x11, + -1,+0,+1,-2,1,0x40, -1,+0,+1,-1,0,0x66, -1,+0,+1,+0,1,0x22, + -1,+0,+1,+1,0,0x33, -1,+0,+1,+2,1,0x10, -1,+1,+1,-1,1,0x44, + -1,+1,+1,+0,0,0x66, -1,+1,+1,+1,0,0x22, -1,+1,+1,+2,0,0x10, + -1,+2,+0,+1,0,0x04, -1,+2,+1,+0,1,0x04, -1,+2,+1,+1,0,0x04, +- +0,-2,+0,+0,1,0x80, +0,-1,+0,+1,1,0x88, +0,-1,+1,-2,0,0x40, ++ +0,-2,+0,+0,1,-128, +0,-1,+0,+1,1,-120, +0,-1,+1,-2,0,0x40, + +0,-1,+1,+0,0,0x11, +0,-1,+2,-2,0,0x40, +0,-1,+2,-1,0,0x20, + +0,-1,+2,+0,0,0x30, +0,-1,+2,+1,1,0x10, +0,+0,+0,+2,1,0x08, + +0,+0,+2,-2,1,0x40, +0,+0,+2,-1,0,0x60, +0,+0,+2,+0,1,0x20, + +0,+0,+2,+1,0,0x30, +0,+0,+2,+2,1,0x10, +0,+1,+1,+0,0,0x44, + +0,+1,+1,+2,0,0x10, +0,+1,+2,-1,1,0x40, +0,+1,+2,+0,0,0x60, +- +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,0x80, +- +1,-1,+1,+1,0,0x88, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, ++ +0,+1,+2,+1,0,0x20, +0,+1,+2,+2,0,0x10, +1,-2,+1,+0,0,-128, ++ +1,-1,+1,+1,0,-120, +1,+0,+1,+2,0,0x08, +1,+0,+2,-1,0,0x40, + +1,+0,+2,+1,0,0x10 + }, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 }; + ushort (*brow[5])[4], *pix; +@@ -7771,7 +7772,7 @@ void CLASS adobe_coeff (const char *make, const char * + { 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } }, + { "Phase One P65", 0, 0, + { 8035,435,-962,-6001,13872,2320,-1159,3065,5434 } }, +- { "Red One", 704, 0xffff, /* DJC */ ++ { "Red One", 704, -1, /* DJC */ + { 21014,-7891,-2613,-3056,12201,856,-2203,5125,8042 } }, + { "Samsung EX1", 0, 0x3e00, + { 8898,-2498,-994,-3144,11328,2066,-760,1381,4576 } }, +@@ -9547,7 +9548,7 @@ void CLASS tiff_head (struct tiff_hdr *th, int full) + strncpy (th->desc, desc, 512); + strncpy (th->make, make, 64); + strncpy (th->model, model, 64); +- strcpy (th->soft, "dcraw v"DCRAW_VERSION); ++ strcpy (th->soft, "dcraw v" DCRAW_VERSION); + t = localtime (×tamp); + sprintf (th->date, "%04d:%02d:%02d %02d:%02d:%02d", + t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);