# # spec file for package freeimage # # Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define tag_ver 3.19.0 %define so_ver 3 Name: freeimage Version: 3.18.0.1909 Release: 2.6 Summary: Multi-format Image Decoder Library License: GPL-2.0-only OR GPL-3.0-only URL: https://freeimage.sourceforge.io/ Source0: %{name}-%{version}.tar.xz Patch0: unbundle.patch # PATCH-FIX-OPENSUSE doxygen.patch asterios.dramis@gmail.com -- Fix documentation building (Based on patch from Fedora) Patch1: doxygen.patch # PATCH-FIX-OPENSUSE makefiles_fixes.patch asterios.dramis@gmail.com -- Fix CFLAGS and CXXFLAGS, removed -s (strip) option, add missing symlinks for libfreeimageplus, remove root user from install Patch3: makefiles_fixes.patch # build with openexr3 Patch9: freeimage-openexr3.patch BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: jxrlib-devel BuildRequires: libjpeg-devel BuildRequires: pkgconfig BuildRequires: pkgconfig(OpenEXR) BuildRequires: pkgconfig(libmng) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libraw) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(zlib) %description FreeImage is a library for developers who would like to support graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. %package devel Summary: Development Files for FreeImage Requires: lib%{name}%{so_ver} = %{version} Requires: lib%{name}plus%{so_ver} = %{version} # libfreeimage-devel was last used at version 3.10.0 Provides: lib%{name}-devel = %{version} Obsoletes: lib%{name}-devel < %{version} %description devel This package provides development libraries and headers needed to build software using FreeImage. %package -n lib%{name}%{so_ver} Summary: Multi-format Image Decoder Library %description -n lib%{name}%{so_ver} FreeImage is a library for developers who would like to support graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. %package -n lib%{name}plus%{so_ver} Summary: Multi-format Image Decoder Library %description -n lib%{name}plus%{so_ver} FreeImage is a library for developers who would like to support graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. %prep %autosetup -p1 %build # access to libtiff/libjpeg internals requires internal headers, requires # bundled copy of the libs, which is a no-no. # Disable the affected components without removing files (which may be # referenced in the build system). # : >Source/FreeImage/PluginG3.cpp >Source/Metadata/XTIFF.cpp \ >Source/FreeImageToolkit/JPEGTransform.cpp \ >Source/FreeImage/PluginTIFF.cpp # sanitize encodings / line endings for file in `find . -type f -name '*.c' -or -name '*.cpp' -or -name '*.h' -or -name '*.txt' -or -name Makefile`; do iconv --from=ISO-8859-15 --to=UTF-8 $file > $file.new && \ sed -i 's|\r||g' $file.new && \ touch -r $file $file.new && mv $file.new $file done sh ./gensrclist.sh sh ./genfipsrclist.sh if grep -q 'SRCS = $' Makefile.srcs; then echo "Empty source list generated. Broken OBS package." exit 1 fi export CFLAGS="%{optflags} -fPIC" export CXXFLAGS="%{optflags} -fPIC" %make_build -f Makefile.gnu %make_build -f Makefile.fip pushd Wrapper/FreeImagePlus/doc doxygen FreeImagePlus.dox popd %install %make_install INSTALLDIR=%{buildroot}%{_libdir} make -f Makefile.fip DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}%{_libdir} install # Remove static libraries rm -f %{buildroot}%{_libdir}/*.a %post -n lib%{name}%{so_ver} -p /sbin/ldconfig %postun -n lib%{name}%{so_ver} -p /sbin/ldconfig %post -n lib%{name}plus%{so_ver} -p /sbin/ldconfig %postun -n lib%{name}plus%{so_ver} -p /sbin/ldconfig %files devel %doc Whatsnew.txt license-*.txt %doc Wrapper/FreeImagePlus/doc/html/ %{_includedir}/FreeImage.h %{_includedir}/FreeImagePlus.h %{_libdir}/libfreeimage.so %{_libdir}/libfreeimageplus.so %files -n lib%{name}%{so_ver} %{_libdir}/lib%{name}.so.3* %{_libdir}/lib%{name}-%{tag_ver}.so %files -n lib%{name}plus%{so_ver} %{_libdir}/lib%{name}plus.so.3* %{_libdir}/lib%{name}plus-%{tag_ver}.so %changelog * Tue Oct 17 2023 Ich - Unbreak the build of all downstream packages, repeal excessive excludes from _service, redo unbundle.patch [boo#1216332] * Thu Sep 7 2023 Enrico Belleri - Update to SVN revision 1909: * added the 'ExtraSamples' tag key to the FIMD_EXIF_MAIN & FIMD_EXIF_EXIF metadata models * added support for Exif v2.3.2 tags * improved TIFF compression when using float images with TIFF_ADOBE_DEFLATE or TIFF_LZW flag * improved performance of _MemoryReadProc function (see FreeImageIO.cpp) * improved TIFF validation against Canon CR2 files (CR2 files are no longer recognized as TIFF) * improved TIFF plugin when working with malicious images * improved BMP plugin when working with malicious images * improved FreeImage_LoadFromMemory robustness when working with malicious images * fixed JXR plugin when working under a Linux OS * improved PFM plugin against malicious images * improved JXR plugin against malicious images * improved Targa plugin against malicious images * improved DDS plugin against malicious images * improved PCX plugin against malicious images * improved PNM plugin against malicious images * improved TIFF plugin against malicious images * improved J2K plugin against malicious images * fixed FreeImage_OpenMultiBitmap with usage of filenames longer than 255 characters & Windows Long Path disabled * TIFF images saved with TIFF_DEFLATE compression are saved to images with TIFF_ADOBE_DEFLATE compresssion (TIFF_DEFLATE is obsolete) * fixed FreeImage_FlipVertical behavior with very large images * fixed FreeImage_Paste behavior with very large images * fixed FreeImage_SeekMemory behavior with 64-bit malicious images - CVE-2019-12211_2019-12213.patch merged upstream - libraw_0_20.patch libraw_0_21.patch merged upstream - bigendian.patch merged upstream - freeimage-no-return-in-nonvoid.patch merged upstream - edit unbundle.patch - closes boo#1135736 boo#1135731 boo#1214776 boo#1214557 boo#1214555 boo#1214556 - Fixes CVEs: CVE-2019-12213 CVE-2019-12211 CVE-2020-21426 CVE-2020-21427 CVE-2020-21428 CVE-2020-22524 * Thu Jan 19 2023 Dominique Leuenberger - Add libraw_0_21.patch: Fix build against libraw 0.21. * Sat Jun 18 2022 Jan Engelhardt - Adjust unbundle.patch to work with tiff >= 4.4.0 [boo#1200451] - Refresh doxygen.patch as -p1, use %%autosetup - Trim redundant information from descriptions * Wed Apr 14 2021 pgajdos@suse.com - added patches fix build with openexr3 + freeimage-openexr3.patch * Mon Aug 24 2020 Dirk Stoecker - fix build with libraw 0.20 (libraw_0_20.patch) * Fri May 15 2020 Tomáš Chvátal - Add patch to fix build on bigendian: * bigendian.patch * Fri May 15 2020 Tomáš Chvátal - Add patch CVE-2019-12211_2019-12213.patch to fix: * bsc#113576 CVE-2019-12211 * bsc#1135731 CVE-2019-12213 * Tue Sep 11 2018 Ondřej Súkup - update to 3.18.0 - refresh/replace unbudle.patch - add freeimage-no-return-in-nonvoid.patch - drop CVE-2016-5684.patch and CVE-2015-0852.patch - refresh doxygen.patch * removed FreeImage_RotateClassic * removed internal Deprecation Manager * DDS plugin now convert 16-bit uncompressed RGB (RGB444, RGB555, RGB565) to 24-bit RGB on loading * added saving support to the PSD plugin * FreeImage_ConvertToRawBits now deals with palletized images containing transparency during conversion * added saving support for 32-bit CMYK in JPEG plugin * added FreeImage_Validate functions: added FreeImage_Validate added FreeImage_ValidateU added FreeImage_ValidateFromHandle added FreeImage_ValidateFromMemory * fixed PCX loader against malicious images with a bad window specification * fixed TIFF loader with loading of RGB[A]F float images * improved loading speed of PSD plugin * fixed support of snprintf in Visual Studio 2015 * improved GIF signature validation * improved TARGA signature validation * disabled ICC sRGB profile checking in PluginPNG:Save * fixed endianness detection on some architectures * fixed saving of 32-bit CMYK converted to 24-bit RGB on loading (remove ICC profile from Exif metadata) * fixed FreeImage_IsTransparent and FreeImage_GetColorType returned value for RGBA[16,F] images flagged as CMYK * fixed a bug in FreeImage_Clone when working with wrapped buffer * fixed a bug in PluginBMP:Save when saving a dib created with FreeImage_CreateView * fixed loading of uncompressed DDS files when width / height are not a multiple of 4 * fixed XPM loader against malicious images with a bad header specification * fixed TIFF loader with Exif loading (saves and restores offset and dir when exif is loaded) * refactored MultiPage and CacheFile mechanism * fixed PCX file conversion crash on special files * fixed FreeImage_FillBackground when using blending with an alpha-transparent foreground color over an opaque background * fixed 64-bit conversion of parameters in sprintf calls (required with C++ 11) * fixed static cast to boolean in PluginJPEG * improved error handling in PluginPNG * fixed wrong exposure in exported HDR files * fixed PluginTIFF:ReadThumbnail behavior when reading TIF with Exif metadata * Wed Jan 24 2018 kbabioch@suse.com - Add CVE-2016-5684.patch: Fix an exploitable out-of-bounds write vulnerability in the XMP image handling functionality, which can cause an arbitrary memory overwrite resulting in code execution (CVE-2016-5684 boo#1002621). * Mon Jun 13 2016 dimstar@opensuse.org - Fix makefiles_fixes.patch to fix linking with as-needed: do list libraries to link after the modules using them (boo#980069). * Sun Feb 21 2016 schwab@suse.de - Build with -fPIC. * Tue Dec 8 2015 p.drouand@gmail.com - Update to version 3.17.0 * FreeImage now uses LibPNG 1.6.16 * FreeImage now uses LibWebP 0.4.2 (GIT patch 2015-03-03) * FreeImage now uses LibRaw 0.17-Alpha1 * FreeImage now uses LibTIFF 4.0.4 (CVS patch 2015-01-26) * FreeImage now uses OpenEXR 2.2.0 * removed VS 2003 project files : this IDE is no longer supported because of its outdated C++ compiler * added FreeImage_ConvertFromRawBitsEx * added RAW_UNPROCESSED load flag to the RAW plugin * added FreeImage_SetMetadataKeyValue * added support for metadata writing to the JPEG-JXR plugin * added VS 2013 project files * added support for PNG tIME metadata (read/write, handle as Exif-TIFF DateTime) * added explicit definition of endianness and color order in compiler options * added FIQ_LFPQUANT quantizer algorithm * added support for input 32-bit dib in Wu quantizer * added FreeImage_ConvertToRGBAF and updated conversions in FreeImage_ConvertToType * added FreeImage_ConvertToRGBA16 and updated conversions in FreeImage_ConvertToType * added FreeImage_CreateView * added FreeImage_RescaleRect * added FreeImage_GetMemorySize * ICO plugin: improved support for Vista icons * fixed a rounding error in RGB to greyscale conversion formula * fixed Makefile.fip so that it installs symlinks * fixed a potential memory access violation in PluginHDR Save function * fixed a bug in FreeImage_LookupSVGColor ("green" color was not found) * fixed TARGA signature validation for TARGA versions < 2.0 * fixed FreeImage_GetScanLine not working with very large images on x64 platforms * improved PluginTIFF compatibility with LibTIFF 4 * fixed a segfault occuring on a corrupted animated GIF * improved memory allocation in PluginRAW * fixed loading/saving of TIFF containing a GPS IFD inside the Exif-TIFF metadata segment (the solution is to ignore the tag) * fixed a bug in FreeImage_JPEGCrop*/_JPEGTransform* functions occuring when using the same source / destination filename * fixed a bug with output image quality in PluginJP2::Save & PluginJ2K::Save functions (regression from FI 3.15.4) * improved RAW file format detection * fixed FreeImage_GetFileType behavior with ANI file formats * improved Exif reader so as to handle Exif IFD with a suspicious offset (can occur with maker notes) * fixed a memory leak in PluginPNG:Save occuring when dealing with invalid PNG files * fixed PNG plugin handling of 16-bit grayscale + 16-bit alpha images * fixed PNG plugin handling of 16-bit grayscale + tRNS chunk images * fixed PNG plugin handling of 24-bit RGB + tRNS chunk images * fixed PNG plugin handling of 1-,4-bit greyscale/palettized + tRNS chunk images * fixed invalid directory delimiter in include statement (mingw-w64) in Source/LibJXR/image/sys/strcodec.h * fixed Invalid condition for defining _byteswap_ulong (mingw-w64) in Source/LibJXR/image/sys/strcodec.c * fixed FreeImage_Get*Mask not returning 0 for greyscale images * fixed loading of external plugins when using UNICODE directory names to store plugins * fixed loading of JXR files when using memory streams * added Dist/ directory creation in Makefiles (in case it is not already present) - For changes from previous versions, please read the Whatnew.txt file - Remove some obsolete patches * use_system_libs.patch * use_system_libs_openjpeg.patch * use_system_libs_libpng15.patch * use_system_libs_libpng14.patch * libraw_types.patch - Update makefiles_fixes.patch - Add patches from Fedora * unbundle.patch * CVE-2015-0852.patch - Use download Url as source - Add dependencies * jxrlib-devel * libjpeg-devel * openjpeg2-devel instead of openjpeg-devel * pkgconfig(libpng) * pkgconfig(libraw) instead of libraw-devel * pkgconfig(libmng) * pkgconfig(libtiff-4) * pkgconfig(libwebp) * pkgconfig(OpenEXR) * pkgconfig(zlib) instead of zlib-devel * unzip - Drop support for SLE11; doesn't build anyway * Sat Jun 22 2013 joop.boonen@opensuse.org - Corrected the license * http://freeimage.sourceforge.net/license.html * FreeImage Open Source Dual-License * FreeImage is licensed under the GNU General Public License, version 2.0 (GPLv2) or version 3.0 (GPLv3), and the FreeImage Public License (FIPL) * Use the liberal FreeImage Public License to use FreeImage commercially or * Use the GNU General Public License to use FreeImage into your open source project. * Fri Jan 4 2013 prusnak@opensuse.org - updated to version 3.15.4 * see http://freeimage.sourceforge.net/news.html * Sun Oct 28 2012 asterios.dramis@gmail.com - Removed libpng fixes from use_system_libs.patch and instead added two patches (use_system_libs_libpng14.patch and use_system_libs_libpng15.patch) to support both libpng14 and libpng15 (currently in Factory). * Sat Mar 31 2012 asterios.dramis@gmail.com - Update to version 3.15.3: * Lots of changes (see http://freeimage.sourceforge.net/news.html for details). - Removed fPIC.diff and freeimage-3100-x86_64.diff patches (fixed upstream). - Replaced noroot.diff with makefiles_fixes.patch (include also fixes for CFLAGS and CXXFLAGS, remove -s (strip) option, add missing symlinks for libfreeimageplus). - Added the following patches: * doxygen.patch: Fix documentation building * use_system_libs.patch: Use system libraries (except except libjpeg and libtiff) * use_system_libs_openjpeg.patch: Use system libraries (openjpeg) - Spec file updates: * Added OpenEXR-devel, libpng-devel, libraw-devel, libraw-devel-static (for openSUSE 11.4), openjpeg-devel (for openSUSE > 12.1) and zlib-devel build requirements since the package now needs these system libraries to compile. * Added doxygen and unzip build requirements to build the documentation and extract the package sources. * Renamed libfreeimage-devel to freeimage-devel and added the necessary Provides/Obsoletes entries for libfreeimage-devel. * Added a libfreeimageplus3 subpackage. * Remove static libraries. * Fri Mar 23 2012 jengelh@medozas.de - .cpp files indicate that FIPL is used (contains a disclaimer clause that is untypical of GPL, but can be found in FIPL). No notice in the source files that GPL is an alternative. * Sat Jul 2 2011 jengelh@medozas.de - Remove conflicting %%debug_package: OBS deals with that already - Remove unnecessary %%clean section - Use %%_smp_mflags