FreeBSD Bugzilla – Attachment 181815 Details for
Bug 218681
graphics/freeimage - rework, upgrade, unbreak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Update, ubreak freeimage
freeimage-update.patch (text/plain), 39.55 KB, created by
Mikhail Teterin
on 2017-04-15 20:53:03 UTC
(
hide
)
Description:
Update, ubreak freeimage
Filename:
MIME Type:
Creator:
Mikhail Teterin
Created:
2017-04-15 20:53:03 UTC
Size:
39.55 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 438522) >+++ Makefile (working copy) >@@ -2,11 +2,7 @@ > # $FreeBSD$ > > PORTNAME= freeimage >-PORTVERSION= 3.16.0 >-PORTREVISION= 2 >-# Version 3.17.0 is available, but does not build on i386 (and probably >-# other 32-bit arches) without some not-quite-trivial patching. If one >-# decides to update the port, please make sure 32-bit builds are tested! >+PORTVERSION= 3.17.0 > CATEGORIES= graphics > MASTER_SITES= SF/${PORTNAME}/Source%20Distribution/${PORTVERSION} > DISTNAME= FreeImage${PORTVERSION:S/.//g} >@@ -14,49 +10,46 @@ > MAINTAINER= ports@FreeBSD.org > COMMENT= Simple C/C++ bitmap graphics library > >-USES= dos2unix gmake zip >-DOS2UNIX_FILES= Source/LibOpenJPEG/opj_malloc.h \ >- Source/LibRawLite/dcraw/dcraw.c \ >- Source/LibRawLite/internal/dcraw_common.cpp >+LIB_DEPENDS= libopenjp2.so:graphics/openjpeg \ >+ libpng16.so:graphics/png \ >+ libraw.so:graphics/libraw \ >+ libtiff.so:graphics/tiff \ >+ libwebp.so:graphics/webp \ >+ libHalf.so:graphics/ilmbase \ >+ libjxrglue.so:graphics/libjxr \ >+ libIlmImf.so:graphics/OpenEXR >+ >+USES= dos2unix jpeg uidfix zip >+DOS2UNIX_FILES= TestAPI/testJPEG.cpp TestAPI/MainTestSuite.cpp > USE_LDCONFIG= yes > WRKSRC= ${WRKDIR}/FreeImage >-MAKE_ARGS= CC="${CC}" CPP="${CPP}" CXX="${CXX}" > >-CFLAGS+= -fexceptions -fvisibility=hidden >-CFLAGS_aarch64= -fPIC >-CFLAGS_amd64= -fPIC >+# Do not even extract the the ancient versions of the >+# various dependencies -- rely on their ports instead: >+EXCLUDE= LibJPEG LibJXR LibOpenJPEG LibPNG LibRawLite LibTIFF4 \ >+ LibWebP OpenEXR ZLib >+EXTRACT_AFTER_ARGS= -a \ >+ ${EXCLUDE:C,^(.*)$,-x FreeImage/Source/\1/* -x FreeImage/Source/\1,} \ >+ -x FreeImage/Wrapper/Delphi* \ >+ -x FreeImage/Wrapper/FreeImage.NET* \ >+ -x FreeImage/Wrapper/VB6* > >-PLIST_FILES= include/FreeImage.h \ >- include/FreeImagePlus.h \ >- lib/libfreeimage.a \ >- lib/libfreeimage-${PORTVERSION}.so \ >- lib/libfreeimage.so.3 \ >- lib/libfreeimage.so \ >- lib/libfreeimageplus.a \ >- lib/libfreeimageplus-${PORTVERSION}.so \ >- lib/libfreeimageplus.so.3 \ >- lib/libfreeimageplus.so >+MAKEFILE= ${FILESDIR}/BSDmakefile > > .include <bsd.port.options.mk> > >-.if ${ARCH} == amd64 || ${ARCH} == powerpc >-USES+= compiler:c++0x >-.endif >+do-configure: >+ ${LN} -sf ${FILESDIR}/BSDmakefile.Source ${WRKSRC}/Source/BSDmakefile >+ ${LN} -sf ${FILESDIR}/BSDmakefile.FreeImagePlus ${WRKSRC}/Wrapper/FreeImagePlus/BSDmakefile >+ ${LN} -sf ${FILESDIR}/BSDmakefile.TestAPI ${WRKSRC}/TestAPI/BSDmakefile > > post-patch: >- @${REINPLACE_CMD} -e 's|/usr|${PREFIX}| ; s|-o root -g root ||' \ >- ${WRKSRC}/Makefile.gnu ${WRKSRC}/Makefile.fip >+ @${REINPLACE_CMD} -e 's|tiffiop.h|tiffio.h|' \ >+ -e 's|#include *"\.\./.*/\([^/]*\)" *$$|#include <\1>|' \ >+ ${WRKSRC}/Source/*/*.[ch]* > >-post-build: >- ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f Makefile.fip ${_MAKE_JOBS} \ >- ${MAKE_ARGS} -C ${BUILD_WRKSRC} >+regression-test test check: build >+ # Complaints about "uknown tag" are considered Ok >+ cd ${WRKSRC}/TestAPI && ./testAPI > >-post-install: >- ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f Makefile.fip ${MAKE_ARGS} \ >- -C ${INSTALL_WRKSRC} ${INSTALL_TARGET} >- ${LN} -sf libfreeimageplus.so.3 \ >- ${STAGEDIR}${PREFIX}/lib/libfreeimageplus.so >- ${LN} -sf libfreeimageplus-${PORTVERSION}.so \ >- ${STAGEDIR}${PREFIX}/lib/libfreeimageplus.so.3 >- > .include <bsd.port.mk> >Index: distinfo >=================================================================== >--- distinfo (revision 438522) >+++ distinfo (working copy) >@@ -1,2 +1,3 @@ >-SHA256 (FreeImage3160.zip) = 03af32dd60140d07515ddfe7b4f467baa3b888a72ea78828811aded7adb42f60 >-SIZE (FreeImage3160.zip) = 5669228 >+TIMESTAMP = 1492192692 >+SHA256 (FreeImage3170.zip) = fbfc65e39b3d4e2cb108c4ffa8c41fd02c07d4d436c594fff8dab1a6d5297f89 >+SIZE (FreeImage3170.zip) = 7020636 >Index: files/BSDmakefile >=================================================================== >--- files/BSDmakefile (nonexistent) >+++ files/BSDmakefile (working copy) >@@ -0,0 +1,5 @@ >+SUBDIR= Source >+SUBDIR+=Wrapper/FreeImagePlus >+SUBDIR+=TestAPI >+ >+.include <bsd.subdir.mk> > >Property changes on: files/BSDmakefile >___________________________________________________________________ >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: files/BSDmakefile.FreeImagePlus >=================================================================== >--- files/BSDmakefile.FreeImagePlus (nonexistent) >+++ files/BSDmakefile.FreeImagePlus (working copy) >@@ -0,0 +1,18 @@ >+LIB_CXX= freeimageplus >+SHLIB_MAJOR= 3 >+INCS= FreeImagePlus.h >+NO_PROFILE= nope >+ >+LIBDIR= ${PREFIX}/lib >+INCLUDEDIR= ${PREFIX}/include >+ >+SRCS= FreeImagePlus.cpp fipImage.cpp fipMemoryIO.cpp fipMetadataFind.cpp \ >+ fipMultiPage.cpp fipTag.cpp >+ >+CXXFLAGS+=-I. -I${.CURDIR:H:H}/Source >+ >+LDADD= -L${.CURDIR:H:H}/Source -lfreeimage >+ >+.PATH: src >+ >+.include <bsd.lib.mk> > >Property changes on: files/BSDmakefile.FreeImagePlus >___________________________________________________________________ >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: files/BSDmakefile.Source >=================================================================== >--- files/BSDmakefile.Source (nonexistent) >+++ files/BSDmakefile.Source (working copy) >@@ -0,0 +1,37 @@ >+LIB_CXX= freeimage >+SHLIB_MAJOR= ${VER_MAJOR} >+INCS= FreeImage.h >+NO_PROFILE= nope >+ >+LIBDIR= ${PREFIX}/lib >+INCLUDEDIR= ${PREFIX}/include >+ >+.include "${.CURDIR:H}/Makefile.srcs" >+ >+SRCS:= ${SRCS:M*/Source/FreeImage*/*:T} ${SRCS:M*/Source/Metadata/*:T} \ >+ ${SRCS:M*/Source/DeprecationManager} >+# Disable the plugins, which require access to internal structures of >+# the other libraries. Similar thing is also done by Debian and Fedora... >+SRCS:= ${SRCS:N*PluginG3.cpp} # Requires TIFF internals >+SRCS:= ${SRCS:N*JPEGTransform.cpp} # Requires JPEG internals >+ >+OJPCFLAGS!= pkgconf libopenjp2 --cflags >+OJPLIBS!= pkgconf libopenjp2 --libs >+ILMLIBS!= pkgconf IlmBase --libs >+CXXFLAGS+= -fexceptions -fvisibility=hidden >+CXXFLAGS+= -IDeprecationManager -IMetadata -I. >+CXXFLAGS+= -I${LOCALBASE}/include/OpenEXR >+CXXFLAGS+= -I${LOCALBASE}/include/libraw >+CXXFLAGS+= -I${LOCALBASE}/include/jxrlib >+CXXFLAGS+= -I${LOCALBASE}/include/webp >+CXXFLAGS+= ${OJPCFLAGS} >+CXXFLAGS+= -I${LOCALBASE}/include -DOS_CODE=0x03 >+CXXFLAGS+= -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-switch -Wno-unused-value -Werror >+CFLAGS+= -I. -Werror >+ >+.PATH: FreeImage FreeImageToolkit Metadata DeprecationMgr >+ >+LDADD= -L${LOCALBASE}/lib >+LDADD+= -lopenjp2 -ljxrglue -ljpeg -lpng16 -lraw -ltiff -lwebpmux -lIlmImf -lHalf -lz >+ >+.include <bsd.lib.mk> > >Property changes on: files/BSDmakefile.Source >___________________________________________________________________ >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: files/BSDmakefile.TestAPI >=================================================================== >--- files/BSDmakefile.TestAPI (nonexistent) >+++ files/BSDmakefile.TestAPI (working copy) >@@ -0,0 +1,10 @@ >+PROG_CXX= testAPI >+NO_MAN= ha-ha >+INTERNALPROG= do not install >+ >+SRCS!= echo *.cpp >+ >+CXXFLAGS+=-I${.CURDIR:H}/Source >+LDADD= -L${.CURDIR:H}/Source -Wl,-rpath=${.CURDIR:H}/Source -lfreeimage >+ >+.include <bsd.prog.mk> > >Property changes on: files/BSDmakefile.TestAPI >___________________________________________________________________ >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: files/patch-CVE-2016-5684 >=================================================================== >--- files/patch-CVE-2016-5684 (nonexistent) >+++ files/patch-CVE-2016-5684 (working copy) >@@ -0,0 +1,31 @@ >+From: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org> >+Date: Mon, 10 Oct 2016 08:22:44 +0100 >+Subject: CVE-2016-5684 >+ >+--- >+ Source/FreeImage/PluginXPM.cpp | 7 ++++++- >+ 1 file changed, 6 insertions(+), 1 deletion(-) >+ >+--- Source/FreeImage/PluginXPM.cpp >++++ Source/FreeImage/PluginXPM.cpp >+@@ -181,6 +181,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) { >+ } >+ 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, int page, int flags, void *data) { >+ 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 > >Property changes on: files/patch-CVE-2016-5684 >___________________________________________________________________ >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: files/patch-Disable-testing-of-JPEG-transform >=================================================================== >--- files/patch-Disable-testing-of-JPEG-transform (nonexistent) >+++ files/patch-Disable-testing-of-JPEG-transform (working copy) >@@ -0,0 +1,44 @@ >+Adapted from Debian: >+ >+From: Ghislain Antony Vaillant <ghisvail@gmail.com> >+Date: Tue, 3 Nov 2015 18:15:18 +0000 >+Subject: Disable testing of JPEG transform. >+ >+Reason: the JPEG transform features are disabled from the Debian build as a >+result of the stripping of the vendored dependencies. >+--- >+ TestAPI/testJPEG.cpp | 4 ++++ >+ 1 file changed, 4 insertions(+) >+ >+diff --git a/TestAPI/testJPEG.cpp b/TestAPI/testJPEG.cpp >+index 798033d..94638b9 100644 >+--- TestAPI/testJPEG.cpp >++++ TestAPI/testJPEG.cpp >+@@ -25,6 +25,7 @@ >+ // Local test functions >+ // ---------------------------------------------------------- >+ >++#if 0 >+ void testJPEGTransform(const char *src_file) { >+ BOOL bResult; >+ BOOL perfect; >+@@ -193,11 +194,13 @@ void testJPEGSameFile(const char *src_file) { >+ bResult = FreeImage_JPEGTransform("test.jpg", "test.jpg", FIJPEG_OP_ROTATE_270, perfect); >+ assert(bResult); >+ } >++#endif >+ >+ // Main test function >+ // ---------------------------------------------------------- >+ >+ void testJPEG() { >++#if 0 >+ const char *src_file = "exif.jpg"; >+ >+ printf("testJPEG (should throw exceptions) ...\n"); >+@@ -213,4 +216,5 @@ void testJPEG() { >+ >+ // using the same file for src & dst is allowed >+ testJPEGSameFile(src_file); >++#endif >+ } > >Property changes on: files/patch-Disable-testing-of-JPEG-transform >___________________________________________________________________ >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: files/patch-FreeImage.h >=================================================================== >--- files/patch-FreeImage.h (nonexistent) >+++ files/patch-FreeImage.h (working copy) >@@ -0,0 +1,19 @@ >+--- Source/FreeImage.h 2015-03-04 02:17:54.000000000 -0500 >++++ Source/FreeImage.h 2017-04-15 00:35:12.308397000 -0400 >+@@ -130,5 +130,4 @@ >+ >+ #ifndef _WINDOWS_ >+-#define _WINDOWS_ >+ >+ #ifndef FALSE >+@@ -155,7 +154,9 @@ >+ typedef uint16_t WORD; >+ typedef uint32_t DWORD; >+-typedef int32_t LONG; >++typedef long LONG; >++#ifndef _LIBRAW_TYPES_H /* libraw defines these on its own -- differently */ >+ typedef int64_t INT64; >+ typedef uint64_t UINT64; >++#endif >+ #else >+ // MS is not C99 ISO compliant > >Property changes on: files/patch-FreeImage.h >___________________________________________________________________ >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: files/patch-Source-OpenEXR-IlmImf_ImfAutoArray.h >=================================================================== >--- files/patch-Source-OpenEXR-IlmImf_ImfAutoArray.h (revision 438522) >+++ files/patch-Source-OpenEXR-IlmImf_ImfAutoArray.h (nonexistent) >@@ -1,11 +0,0 @@ >---- Source/OpenEXR/IlmImf/ImfAutoArray.h.orig 2013-01-30 11:10:28.000000000 +0100 >-+++ Source/OpenEXR/IlmImf/ImfAutoArray.h 2013-01-30 12:05:10.000000000 +0100 >-@@ -46,6 +46,8 @@ >- >- #include "OpenEXRConfig.h" >- >-+#include <string.h> >-+ >- namespace Imf { >- >- > >Property changes on: files/patch-Source-OpenEXR-IlmImf_ImfAutoArray.h >___________________________________________________________________ >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: files/patch-integer_overflow_ljpeg_start >=================================================================== >--- files/patch-integer_overflow_ljpeg_start (revision 438522) >+++ files/patch-integer_overflow_ljpeg_start (nonexistent) >@@ -1,34 +0,0 @@ >-Description: Fix integer overflow in the ljpeg_start function in dcraw >-Author: Alex Tutubalin <lexa@lexa.ru> >-Bug-Debian: https://bugs.debian.org/786790 >-Origin: https://github.com/LibRaw/LibRaw/commit/4606c28f494a750892c5c1ac7903e62dd1c6fdb5 >- https://github.com/rawstudio/rawstudio/commit/983bda1f0fa5fa86884381208274198a620f006e >-Bug: https://security-tracker.debian.org/tracker/CVE-2015-3885 >-Bug: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3885 >-Reviewed-By: Anton Gladky <gladk@debian.org> >-Last-Update: 2015-10-29 >- >---- freeimage-3.15.4.orig/Source/LibRawLite/dcraw/dcraw.c >-+++ Source/LibRawLite/dcraw/dcraw.c >-@@ -768,7 +768,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; >- >---- freeimage-3.15.4.orig/Source/LibRawLite/internal/dcraw_common.cpp >-+++ Source/LibRawLite/internal/dcraw_common.cpp >-@@ -630,7 +630,8 @@ void CLASS canon_compressed_load_raw() >- >- 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; >- > >Property changes on: files/patch-integer_overflow_ljpeg_start >___________________________________________________________________ >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: files/patch-jpeg >=================================================================== >--- files/patch-jpeg (nonexistent) >+++ files/patch-jpeg (working copy) >@@ -0,0 +1,13 @@ >+--- Source/FreeImage/PluginJPEG.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/PluginJPEG.cpp 2017-04-14 17:48:13.304868000 -0400 >+@@ -36,7 +36,7 @@ >+ #include <setjmp.h> >+ >+-#include "../LibJPEG/jinclude.h" >+-#include "../LibJPEG/jpeglib.h" >+-#include "../LibJPEG/jerror.h" >++#include <stdio.h> >++#include <jpeglib.h> >++#include <jerror.h> >+ } >+ > >Property changes on: files/patch-jpeg >___________________________________________________________________ >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: files/patch-jxr >=================================================================== >--- files/patch-jxr (nonexistent) >+++ files/patch-jxr (working copy) >@@ -0,0 +1,11 @@ >+--- Source/FreeImage/PluginJXR.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/PluginJXR.cpp 2017-04-15 00:26:28.574254000 -0400 >+@@ -23,5 +23,6 @@ >+ #include "Utilities.h" >+-#include "../Metadata/FreeImageTag.h" >++#include <FreeImageTag.h> >+ >+-#include "../LibJXR/jxrgluelib/JXRGlue.h" >++#define __ANSI__ >++#include <JXRGlue.h> >+ > >Property changes on: files/patch-jxr >___________________________________________________________________ >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: files/patch-nog3 >=================================================================== >--- files/patch-nog3 (nonexistent) >+++ files/patch-nog3 (working copy) >@@ -0,0 +1,22 @@ >+Building the G3 plugin is of questionable utility, but >+requires access to data not officially exported by libtiff. >+ >+Disable it... >+ >+ -mi >+--- Source/FreeImage/Plugin.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/Plugin.cpp 2017-04-15 01:11:48.347512000 -0400 >+@@ -39,5 +39,5 @@ >+ #include "Plugin.h" >+ >+-#include "../Metadata/FreeImageTag.h" >++#include <FreeImageTag.h> >+ >+ // ===================================================================== >+@@ -264,5 +264,5 @@ >+ s_plugins->AddNode(InitGIF); >+ s_plugins->AddNode(InitHDR); >+- s_plugins->AddNode(InitG3); >++// s_plugins->AddNode(InitG3); >+ s_plugins->AddNode(InitSGI); >+ s_plugins->AddNode(InitEXR); > >Property changes on: files/patch-nog3 >___________________________________________________________________ >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: files/patch-png >=================================================================== >--- files/patch-png (nonexistent) >+++ files/patch-png (working copy) >@@ -0,0 +1,109 @@ >+Based on: >+ >+ From: Ghislain Antony Vaillant <ghisvail@gmail.com> >+ Date: Tue, 3 Nov 2015 15:20:45 +0000 >+ Subject: Fix compatibility with system libpng. >+ >+ [Ghislain Antony Vaillant] >+ The PNG plugin of FreeImage makes use of optional features of libpng, which >+ are not enabled in Debian. This commit adds the necessary guards for FreeImage >+ to compile and run without these features. >+ >+ [Tobias Frost] >+ Fix FTBFS with libpng 1.6. >+ >+--- Source/FreeImage/PluginPNG.cpp >++++ Source/FreeImage/PluginPNG.cpp >+@@ -109,9 +109,11 @@ ReadMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) { >+ // create a tag >+ tag = FreeImage_CreateTag(); >+ if(!tag) return FALSE; >+- >++#ifdef PNG_iTXt_SUPPORTED >+ DWORD tag_length = (DWORD) MAX(text_ptr[i].text_length, text_ptr[i].itxt_length); >+- >++#else >++ DWORD tag_length = text_ptr[i].text_length; >++#endif >+ FreeImage_SetTagLength(tag, tag_length); >+ FreeImage_SetTagCount(tag, tag_length); >+ FreeImage_SetTagType(tag, FIDT_ASCII); >+@@ -179,14 +181,19 @@ WriteMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) { >+ if(mdhandle) { >+ do { >+ memset(&text_metadata, 0, sizeof(png_text)); >++#ifdef PNG_iTXt_SUPPORTED >+ text_metadata.compression = 1; // iTXt, none >++#else >++ text_metadata.compression = -1; >++#endif >+ text_metadata.key = (char*)FreeImage_GetTagKey(tag); // keyword, 1-79 character description of "text" >+ text_metadata.text = (char*)FreeImage_GetTagValue(tag); // comment, may be an empty string (ie "") >+ text_metadata.text_length = FreeImage_GetTagLength(tag);// length of the text string >++#ifdef PNG_iTXt_SUPPORTED >+ text_metadata.itxt_length = FreeImage_GetTagLength(tag);// length of the itxt string >+ text_metadata.lang = 0; // language code, 0-79 characters or a NULL pointer >+ text_metadata.lang_key = 0; // keyword translated UTF-8 string, 0 or more chars or a NULL pointer >+- >++#endif >+ // set the tag >+ png_set_text(png_ptr, info_ptr, &text_metadata, 1); >+ >+@@ -205,10 +212,11 @@ WriteMetadata(png_structp png_ptr, png_infop info_ptr, FIBITMAP *dib) { >+ text_metadata.key = (char*)g_png_xmp_keyword; // keyword, 1-79 character description of "text" >+ text_metadata.text = (char*)FreeImage_GetTagValue(tag); // comment, may be an empty string (ie "") >+ text_metadata.text_length = FreeImage_GetTagLength(tag);// length of the text string >++#ifdef PNG_iTXt_SUPPORTED >+ text_metadata.itxt_length = FreeImage_GetTagLength(tag);// length of the itxt string >+ text_metadata.lang = 0; // language code, 0-79 characters or a NULL pointer >+ text_metadata.lang_key = 0; // keyword translated UTF-8 string, 0 or more chars or a NULL pointer >+- >++#endif >+ // set the tag >+ png_set_text(png_ptr, info_ptr, &text_metadata, 1); >+ bResult &= TRUE; >+@@ -705,11 +713,19 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) { >+ >+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_iCCP)) { >+ png_charp profile_name = NULL; >+- png_bytep profile_data = NULL; >++#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4 || PNG_LIBPNG_VER_MAJOR > 1 >++ png_bytepp profile_data = NULL; >++#else >++ png_charp profile_data = NULL; >++#endif >+ png_uint_32 profile_length = 0; >+ int compression_type; >+ >++#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4 || PNG_LIBPNG_VER_MAJOR > 1 >++ png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, profile_data, &profile_length); >++#else >+ png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, &profile_data, &profile_length); >++#endif >+ >+ // copy ICC profile data (must be done after FreeImage_AllocateHeader) >+ >+@@ -744,8 +760,9 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) { >+ for (png_uint_32 k = 0; k < height; k++) { >+ row_pointers[height - 1 - k] = FreeImage_GetScanLine(dib, k); >+ } >+- >++#ifdef PNG_BENIGN_ERRORS_SUPPORTED >+ png_set_benign_errors(png_ptr, 1); >++#endif >+ png_read_image(png_ptr, row_pointers); >+ >+ // check if the bitmap contains transparency, if so enable it in the header >+@@ -991,7 +1008,11 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void >+ >+ FIICCPROFILE *iccProfile = FreeImage_GetICCProfile(dib); >+ if (iccProfile->size && iccProfile->data) { >+- png_set_iCCP(png_ptr, info_ptr, "Embedded Profile", 0, (png_const_bytep)iccProfile->data, iccProfile->size); >++#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4 || PNG_LIBPNG_VER_MAJOR > 1 >++ //png_set_iCCP(png_ptr, info_ptr, "Embedded Profile", 0, (png_const_bytep)iccProfile->data, iccProfile->size); >++#else >++ png_set_iCCP(png_ptr, info_ptr, "Embedded Profile", 0, (png_charp)iccProfile->data, iccProfile->size); >++#endif >+ } >+ >+ // write metadata > >Property changes on: files/patch-png >___________________________________________________________________ >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: files/patch-warnings >=================================================================== >--- files/patch-warnings (nonexistent) >+++ files/patch-warnings (working copy) >@@ -0,0 +1,239 @@ >+--- Source/FreeImage/PluginGIF.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/PluginGIF.cpp 2017-04-14 17:37:48.942939000 -0400 >+@@ -1028,5 +1028,5 @@ >+ } >+ comment.append(1, '\0'); >+- sprintf(buf, "Comment%d", idx); >++ sprintf(buf, "Comment%zu", idx); >+ DWORD comment_size = (DWORD)comment.size(); >+ FreeImage_SetMetadataEx(FIMD_COMMENTS, dib, buf, 1, FIDT_ASCII, comment_size, comment_size, comment.c_str()); >+--- Source/FreeImage/PluginPICT.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/PluginPICT.cpp 2017-04-14 19:51:56.531330000 -0400 >+@@ -959,5 +959,5 @@ >+ try { >+ // Skip empty 512 byte header. >+- if ( !io->seek_proc(handle, 512, SEEK_CUR) == 0 ) >++ if (io->seek_proc(handle, 512, SEEK_CUR) != 0) >+ return NULL; >+ >+--- Source/FreeImageToolkit/CopyPaste.cpp 2015-03-02 02:07:10.000000000 -0500 >++++ Source/FreeImageToolkit/CopyPaste.cpp 2017-04-14 19:58:50.520119000 -0400 >+@@ -800,5 +800,5 @@ >+ unsigned width = FreeImage_GetWidth(dib); >+ unsigned height = FreeImage_GetHeight(dib); >+- if (left < 0 || right > width || top < 0 || bottom > height) { >++ if (right > width || bottom > height) { >+ return NULL; >+ } >+--- Source/Metadata/TagConversion.cpp 2015-03-02 02:07:10.000000000 -0500 >++++ Source/Metadata/TagConversion.cpp 2017-04-15 16:02:39.025047000 -0400 >+@@ -39,4 +39,5 @@ >+ static std::string buffer; >+ DWORD i; >++ const void *pv; >+ >+ if(!tag) >+@@ -49,14 +50,15 @@ >+ FREE_IMAGE_MDTYPE tag_type = FreeImage_GetTagType(tag); >+ DWORD tag_count = FreeImage_GetTagCount(tag); >++ pv = FreeImage_GetTagValue(tag); >+ >+ switch(tag_type) { >+ case FIDT_BYTE: // N x 8-bit unsigned integer >+ { >+- BYTE *pvalue = (BYTE*)FreeImage_GetTagValue(tag); >++ const uint8_t *pvalue = (const uint8_t *)pv; >+ >+- sprintf(format, "%ld", (LONG) pvalue[0]); >++ sprintf(format, "%u", (unsigned)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %ld", (LONG) pvalue[i]); >++ sprintf(format, " %u", (unsigned)pvalue[i]); >+ buffer += format; >+ } >+@@ -65,5 +67,5 @@ >+ case FIDT_SHORT: // N x 16-bit unsigned integer >+ { >+- unsigned short *pvalue = (unsigned short *)FreeImage_GetTagValue(tag); >++ const uint16_t *pvalue = (const uint16_t *)pv; >+ >+ sprintf(format, "%hu", pvalue[0]); >+@@ -77,10 +79,10 @@ >+ case FIDT_LONG: // N x 32-bit unsigned integer >+ { >+- DWORD *pvalue = (DWORD *)FreeImage_GetTagValue(tag); >++ const uint32_t *pvalue = (const uint32_t *)pv; >+ >+- sprintf(format, "%lu", pvalue[0]); >++ sprintf(format, "%u", (unsigned)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %lu", pvalue[i]); >++ sprintf(format, " %u", (unsigned)pvalue[i]); >+ buffer += format; >+ } >+@@ -89,10 +91,10 @@ >+ case FIDT_RATIONAL: // N x 64-bit unsigned fraction >+ { >+- DWORD *pvalue = (DWORD*)FreeImage_GetTagValue(tag); >++ const uint32_t *pvalue = (const uint32_t *)pv; >+ >+- sprintf(format, "%ld/%ld", pvalue[0], pvalue[1]); >++ sprintf(format, "%lu/%lu", (unsigned long)pvalue[0], (unsigned long)pvalue[1]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %ld/%ld", pvalue[2*i], pvalue[2*i+1]); >++ sprintf(format, " %lu/%lu", (unsigned long)pvalue[2*i], (unsigned long)pvalue[2*i+1]); >+ buffer += format; >+ } >+@@ -101,10 +103,10 @@ >+ case FIDT_SBYTE: // N x 8-bit signed integer >+ { >+- char *pvalue = (char*)FreeImage_GetTagValue(tag); >++ const int8_t *pvalue = (const int8_t *)pv; >+ >+- sprintf(format, "%ld", (LONG) pvalue[0]); >++ sprintf(format, "%d", (int)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %ld", (LONG) pvalue[i]); >++ sprintf(format, " %d", (int)pvalue[i]); >+ buffer += format; >+ } >+@@ -113,10 +115,10 @@ >+ case FIDT_SSHORT: // N x 16-bit signed integer >+ { >+- short *pvalue = (short *)FreeImage_GetTagValue(tag); >++ const int16_t *pvalue = (const int16_t *)pv; >+ >+- sprintf(format, "%hd", pvalue[0]); >++ sprintf(format, "%hd", (short)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %hd", pvalue[i]); >++ sprintf(format, " %hd", (short)pvalue[i]); >+ buffer += format; >+ } >+@@ -125,10 +127,10 @@ >+ case FIDT_SLONG: // N x 32-bit signed integer >+ { >+- LONG *pvalue = (LONG *)FreeImage_GetTagValue(tag); >++ const int32_t *pvalue = (const int32_t *)pv; >+ >+- sprintf(format, "%ld", pvalue[0]); >++ sprintf(format, "%ld", (long)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %ld", pvalue[i]); >++ sprintf(format, " %ld", (long)pvalue[i]); >+ buffer += format; >+ } >+@@ -137,10 +139,10 @@ >+ case FIDT_SRATIONAL:// N x 64-bit signed fraction >+ { >+- LONG *pvalue = (LONG*)FreeImage_GetTagValue(tag); >++ const int64_t *pvalue = (const int64_t *)pv; >+ >+- sprintf(format, "%ld/%ld", pvalue[0], pvalue[1]); >++ sprintf(format, "%ld/%ld", (long)pvalue[0], (long)pvalue[1]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %ld/%ld", pvalue[2*i], pvalue[2*i+1]); >++ sprintf(format, " %ld/%ld", (long)pvalue[2*i], (long)pvalue[2*i+1]); >+ buffer += format; >+ } >+@@ -149,5 +151,5 @@ >+ case FIDT_FLOAT: // N x 32-bit IEEE floating point >+ { >+- float *pvalue = (float *)FreeImage_GetTagValue(tag); >++ const float *pvalue = (const float *)pv; >+ >+ sprintf(format, "%f", (double) pvalue[0]); >+@@ -161,5 +163,5 @@ >+ case FIDT_DOUBLE: // N x 64-bit IEEE floating point >+ { >+- double *pvalue = (double *)FreeImage_GetTagValue(tag); >++ const double *pvalue = (const double *)pv; >+ >+ sprintf(format, "%f", pvalue[0]); >+@@ -173,10 +175,10 @@ >+ case FIDT_IFD: // N x 32-bit unsigned integer (offset) >+ { >+- DWORD *pvalue = (DWORD *)FreeImage_GetTagValue(tag); >++ const uint32_t *pvalue = (const uint32_t *)pv; >+ >+- sprintf(format, "%X", pvalue[0]); >++ sprintf(format, "%lX", (unsigned long)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, " %X", pvalue[i]); >++ sprintf(format, " %lX", (unsigned long)pvalue[i]); >+ buffer += format; >+ } >+@@ -185,5 +187,5 @@ >+ case FIDT_PALETTE: // N x 32-bit RGBQUAD >+ { >+- RGBQUAD *pvalue = (RGBQUAD *)FreeImage_GetTagValue(tag); >++ const RGBQUAD *pvalue = (const RGBQUAD *)pv; >+ >+ sprintf(format, "(%d,%d,%d,%d)", pvalue[0].rgbRed, pvalue[0].rgbGreen, pvalue[0].rgbBlue, pvalue[0].rgbReserved); >+@@ -198,10 +200,10 @@ >+ case FIDT_LONG8: // N x 64-bit unsigned integer >+ { >+- UINT64 *pvalue = (UINT64 *)FreeImage_GetTagValue(tag); >++ const uint64_t *pvalue = (const uint64_t *)pv; >+ >+- sprintf(format, "%ld", pvalue[0]); >++ sprintf(format, "%llu", (unsigned long long)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, "%ld", pvalue[i]); >++ sprintf(format, "%llu", (unsigned long long)pvalue[i]); >+ buffer += format; >+ } >+@@ -211,10 +213,10 @@ >+ case FIDT_IFD8: // N x 64-bit unsigned integer (offset) >+ { >+- UINT64 *pvalue = (UINT64 *)FreeImage_GetTagValue(tag); >++ const uint64_t *pvalue = (const uint64_t *)pv; >+ >+- sprintf(format, "%X", pvalue[0]); >++ sprintf(format, "%llX", (unsigned long long)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, "%X", pvalue[i]); >++ sprintf(format, "%llX", (unsigned long long)pvalue[i]); >+ buffer += format; >+ } >+@@ -224,10 +226,10 @@ >+ case FIDT_SLONG8: // N x 64-bit signed integer >+ { >+- INT64 *pvalue = (INT64 *)FreeImage_GetTagValue(tag); >++ const int64_t *pvalue = (const int64_t *)pv; >+ >+- sprintf(format, "%ld", pvalue[0]); >++ sprintf(format, "%lld", (long long)pvalue[0]); >+ buffer += format; >+ for(i = 1; i < tag_count; i++) { >+- sprintf(format, "%ld", pvalue[i]); >++ sprintf(format, "%lld", (long long)pvalue[i]); >+ buffer += format; >+ } >+@@ -242,5 +244,5 @@ >+ if(max_size == MAX_TEXT_EXTENT) >+ max_size--; >+- memcpy(format, (char*)FreeImage_GetTagValue(tag), max_size); >++ memcpy(format, pv, max_size); >+ format[max_size] = '\0'; >+ buffer += format; >+--- TestAPI/MainTestSuite.cpp 2015-02-25 09:08:38.000000000 -0500 >++++ TestAPI/MainTestSuite.cpp 2017-04-15 01:18:24.712061000 -0400 >+@@ -35,6 +35,5 @@ >+ printf("%s Format\n", FreeImage_GetFormatFromFIF(fif)); >+ } >+- printf(message); >+- printf(" ***\n"); >++ printf("%s ***\n", message); >+ } >+ > >Property changes on: files/patch-warnings >___________________________________________________________________ >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: files/patch-webp >=================================================================== >--- files/patch-webp (nonexistent) >+++ files/patch-webp (working copy) >@@ -0,0 +1,18 @@ >+--- Source/FreeImage/PluginWebP.cpp 2015-03-02 02:07:08.000000000 -0500 >++++ Source/FreeImage/PluginWebP.cpp 2017-04-15 00:38:52.407279000 -0400 >+@@ -23,10 +23,10 @@ >+ #include "Utilities.h" >+ >+-#include "../Metadata/FreeImageTag.h" >++#include <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 <decode.h> >++#include <encode.h> >++ >++#include <mux.h> >+ >+ // ========================================================== > >Property changes on: files/patch-webp >___________________________________________________________________ >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: files/patch-xtiff >=================================================================== >--- files/patch-xtiff (nonexistent) >+++ files/patch-xtiff (working copy) >@@ -0,0 +1,125 @@ >+Adapted from Debian: >+ From: Ghislain Antony Vaillant <ghisvail@gmail.com> >+ Date: Tue, 3 Nov 2015 14:39:33 +0000 >+ Subject: Disable vendored dependencies. >+ >+[...] >+ >+This patch is based on Fedora's FreeImage-3.17.0_unbundle patch. >+--- Source/Metadata/XTIFF.cpp >++++ Source/Metadata/XTIFF.cpp >+@@ -29,13 +29,18 @@ >+ #pragma warning (disable : 4786) // identifier was truncated to 'number' characters >+ #endif >+ >+-#include "../LibTIFF4/tiffiop.h" >++#include <tiffio.h> >+ >+ #include "FreeImage.h" >+ #include "Utilities.h" >+ #include "FreeImageTag.h" >+ #include "FIRational.h" >+ >++extern "C" >++{ >++ int _TIFFDataSize(TIFFDataType type); >++} >++ >+ // ---------------------------------------------------------- >+ // Extended TIFF Directory GEO Tag Support >+ // ---------------------------------------------------------- >+@@ -224,6 +229,33 @@ tiff_write_geotiff_profile(TIFF *tif, FIBITMAP *dib) { >+ // TIFF EXIF tag reading & writing >+ // ---------------------------------------------------------- >+ >++static uint32 exif_tag_ids[] = { >++ EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, >++ EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, >++ EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, >++ EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, >++ EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, >++ EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, >++ EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, >++ EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, >++ EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, >++ EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, >++ EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, >++ EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, >++ EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, >++ EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, >++ EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, >++ EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, >++ EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, >++ EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, >++ EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, >++ EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, >++ EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, >++ EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, >++ EXIFTAG_IMAGEUNIQUEID >++}; >++static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); >++ >+ /** >+ Read a single Exif tag >+ >+@@ -575,43 +607,10 @@ tiff_read_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { >+ >+ // loop over all Core Directory Tags >+ // ### uses private data, but there is no other way >++ // -> Fedora: Best we can do without private headers is to hard-code a list of known EXIF tags and read those >+ if(md_model == TagLib::EXIF_MAIN) { >+- const TIFFDirectory *td = &tif->tif_dir; >+- >+- uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) >+- >+- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { >+- const TIFFField *fld = tif->tif_fields[fi]; >+- >+- const uint32 tag_id = TIFFFieldTag(fld); >+- >+- if(tag_id == lastTag) { >+- continue; >+- } >+- >+- // test if tag value is set >+- // (lifted directly from LibTiff _TIFFWriteDirectory) >+- >+- if( fld->field_bit == FIELD_CUSTOM ) { >+- int is_set = FALSE; >+- >+- for(int ci = 0; ci < td->td_customValueCount; ci++ ) { >+- is_set |= (td->td_customValues[ci].info == fld); >+- } >+- >+- if( !is_set ) { >+- continue; >+- } >+- >+- } else if(!TIFFFieldSet(tif, fld->field_bit)) { >+- continue; >+- } >+- >+- // process *all* other tags (some will be ignored) >+- >+- tiff_read_exif_tag(tif, tag_id, dib, md_model); >+- >+- lastTag = tag_id; >++ for (int i = 0; i < nExifTags; ++i) { >++ tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); >+ } >+ >+ } >+@@ -723,10 +722,9 @@ tiff_write_exif_tags(TIFF *tif, TagLib::MDMODEL md_model, FIBITMAP *dib) { >+ >+ TagLib& tag_lib = TagLib::instance(); >+ >+- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { >+- const TIFFField *fld = tif->tif_fields[fi]; >+- >+- const uint32 tag_id = TIFFFieldTag(fld); >++ for (int fi = 0, nfi = nExifTags; nfi > 0; nfi--, fi++) { >++ const uint32 tag_id = exif_tag_ids[fi]; >++ const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); >+ >+ if(skip_write_field(tif, tag_id)) { >+ // skip tags that are already handled by the LibTIFF writing process > >Property changes on: files/patch-xtiff >___________________________________________________________________ >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: files/patch-zutil >=================================================================== >--- files/patch-zutil (nonexistent) >+++ files/patch-zutil (working copy) >@@ -0,0 +1,14 @@ >+Do not include zutil.h -- we only need it for OS_CODE and we simply >+supply that #define on command-line... >+--- Source/FreeImage/ZLibInterface.cpp 2015-03-02 02:07:10.000000000 -0500 >++++ Source/FreeImage/ZLibInterface.cpp 2017-04-14 18:05:32.342316000 -0400 >+@@ -20,8 +20,7 @@ >+ // ========================================================== >+ >+-#include "../ZLib/zlib.h" >++#include <zlib.h> >+ #include "FreeImage.h" >+ #include "Utilities.h" >+-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ >+ >+ /** > >Property changes on: files/patch-zutil >___________________________________________________________________ >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: pkg-plist >=================================================================== >--- pkg-plist (nonexistent) >+++ pkg-plist (working copy) >@@ -0,0 +1,8 @@ >+include/FreeImage.h >+include/FreeImagePlus.h >+lib/libfreeimage.a >+lib/libfreeimage.so.3 >+lib/libfreeimage.so >+lib/libfreeimageplus.a >+lib/libfreeimageplus.so.3 >+lib/libfreeimageplus.so > >Property changes on: pkg-plist >___________________________________________________________________ >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218681
:
181815
|
181828
|
181829
|
182171
|
182262