commit gimp.817 for openSUSE:12.1:Update
Hello community, here is the log from the commit of package gimp.817 for openSUSE:12.1:Update checked in at 2012-09-03 10:27:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.1:Update/gimp.817 (Old) and /work/SRC/openSUSE:12.1:Update/.gimp.817.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "gimp.817", Maintainer is "" Changes: -------- New Changes file: --- /dev/null 2012-08-23 02:41:28.555381587 +0200 +++ /work/SRC/openSUSE:12.1:Update/.gimp.817.new/gimp.changes 2012-09-03 10:27:31.000000000 +0200 @@ -0,0 +1,1107 @@ +------------------------------------------------------------------- +Wed Aug 22 08:33:14 UTC 2012 - rlmu@suse.com + +- fixed bnc#724628 + VUL-0: CVE-2012-3481: gimp: GIF plugin 'height' / 'len' integer overflow leading to heap-based buffer overflow + +- fixed bnc#763595 + VUL-0: CVE-2012-2763: gimp: buffer overflow in script-fu's server component + +- fixed bnc#769565 + VUL-1: CVE-2012-3236: gimp: NULL ptr crash in fit format handler + +- fixed bnc#775433 + VUL-0: CVE-2012-3403: gimp: Heap buffer overflow when loading external palette files + +------------------------------------------------------------------- +Fri Oct 21 11:19:42 UTC 2011 - vuntz@opensuse.org + +- Change gimp-2.0-scanner-plugin Recommends to a Suggests: this + installs xsane by default, and really, xsane is so horribly + broken UI-wise that we don't want that. + +------------------------------------------------------------------- +Sat Oct 15 04:47:12 UTC 2011 - coolo@suse.com + +- add libtool as buildrequire to make the spec file more reliable + +------------------------------------------------------------------- +Wed Oct 12 15:26:00 UTC 2011 - vuntz@opensuse.org + +- Add a warning comment about changing the content of the branding + package, to make our life easier in branding-openSUSE. + +------------------------------------------------------------------- +Thu Oct 6 21:57:36 UTC 2011 - vuntz@opensuse.org + +- Add iso-codes Recommends since the iso-codes data is used at + runtime, but its presence is not mandatory. +- Remove explicit gtk2 Requires: the library will get + automatically added to the list of Requires. + +------------------------------------------------------------------- +Tue Sep 20 13:34:58 UTC 2011 - vuntz@opensuse.org + +- Update gimp-fix-linking.patch: add another missing -lm. +- Add gimp-poppler-0.18.patch: fix build with poppler 0.17/0.18. + +------------------------------------------------------------------- +Fri Sep 9 13:29:26 UTC 2011 - vuntz@opensuse.org + +- Add gimp-fix-linking.patch: fix linking issue. +- Add gimp-CVE-2011-2896.patch: Fix heap corruption and buffer + overflow in LZW code. Fix bnc#711491, CVE-2011-2896. +- Add gimp-pyslice-cellspacing-fix.patch: fix a crash in the + pyslice plugin. +- Add call to autoreconf, needed by gimp-fix-linking.patch. + +------------------------------------------------------------------- +Wed Jul 6 16:24:31 CEST 2011 - vuntz@opensuse.org + +- Change branding-upstream subpackage: + + Add Requires for gimp since the branding package is useless + without it. + + Update summary and description. + + Make noarch. +- Change branding Requires in main subpackage to be "= %{version}", + instead of ">= 2.4", which is wrong. + +------------------------------------------------------------------- +Wed Jun 15 16:19:39 CEST 2011 - vuntz@opensuse.org + +- Fix build on Factory, by not excluding the + libcontroller-linux-input.so module from the file list of the + main package when we build without hal. It was only excluded to + be part of a hal subpackage when there is the hal dependency. + +------------------------------------------------------------------- +Sun Jun 12 00:14:35 CEST 2011 - vuntz@opensuse.org + +- On 12.1 and later, stop building the gimp-module-hal subpackage: + + we don't want hal anymore on 12.1 and later (see bnc#697016). + We use a build_hal define to control that behavior. + + remove hal-devel BuildRequires + + do not build a gimp-module-hal subpackage anymore + + add gimp-module-hal Obsoletes for smooth upgrades + +------------------------------------------------------------------- +Tue Feb 15 10:13:30 CET 2011 - vuntz@opensuse.org + +- Add gimp-CVE-2010-4540-and-more.patch and + gimp-CVE-2010-4543.patch to fix buffer overflows: CVE-2010-4540, + CVE-2010-4541, CVE-2010-4542, CVE-2010-4543. Fix bnc#662043. + +------------------------------------------------------------------- +Sat Feb 12 17:45:43 CET 2011 - vuntz@opensuse.org + +- Call relevant macros in %post/%postun: + + %desktop_database_post/postun because the package ships at + least one desktop file. + + %icon_theme_cache_post/postun because the package ships themed + icons. +- Pass %{?no_lang_C} to %find_lang so that english documentation + can be packaged with the program, and not in the lang subpackage. + +------------------------------------------------------------------- +Fri Jan 7 10:17:51 CET 2011 - vuntz@opensuse.org + +- Move ownership from various directories from gimp to + libgimp-2_0-0, to not force external gimp plug-ins/modules/etc. + to have a gimp BuildRequires for directory ownership. + +------------------------------------------------------------------- +Mon Dec 20 11:33:02 CET 2010 - vuntz@opensuse.org + +- Split gimp libraries in libgimp-2_0-0 and libgimpui-2_0-0 + subpackages, and add baselibs.conf for those. Fix bnc#660439. +- Change accordingly the Requires of the devel package, and the + scriptlets to run ldconfig. +- Remove explicit glib2-devel and gtk2-devel Requires in devel + package: they will automatically be added the pkgconfig() way. +- Move the gimptool-2.0 man page to the devel subpackage, where the + binary lives. + +------------------------------------------------------------------- +Tue Nov 23 08:28:28 UTC 2010 - aj@suse.de + +- Change lang package Requires to Recommends since it is not + mandatory at runtime. + +------------------------------------------------------------------- +Mon Oct 4 12:09:19 CEST 2010 - vuntz@opensuse.org + +- Update to version 2.6.11: + + bgo#631199: Printing and Print preview broken with cairo 1.10 + + Other bugs fixed: bgo#572865, bgo#628893, bgo#623850, + bgo#624487, bgo#557380, bgo#627009, bgo#626020, bgo#624698, + bgo#624275. + + Updated translations. + +------------------------------------------------------------------- +Mon Aug 9 20:11:10 CEST 2010 - vuntz@opensuse.org + +- Add alsa-devel BuildRequires to build the MIDI Input module. + +------------------------------------------------------------------- +Tue Aug 3 22:34:45 CEST 2010 - dimstar@opensuse.org + +- Update to version 2.6.10: + + bgo#613328: TGA files saved with incorrect header yOrigin data + + bgo#623290: Save As... does not save Windows Bitmap as default + in dialog + + bgo#621363: CMYK decompose broken + + bgo#595170: brush - color from gradient works wrong in + greyscale + + bgo#613838: Error in gimp-hue-saturation PDB call + + bgo#622608: GIMP crashes when clicking any scroll bar from + combo boxes + + bgo#565459: newly opened images are put into the background +- Changes from version 2.6.9: + + bgo#612618: Font selection remains visible + + bgo#620604: Description of "histogram" procedure is slightly + inaccurate + + bgo#541586: Tool options not saved/loaded correctly? + + bgo#614153: Importing PDF files with long titles + + bgo#599233: Dialog of "Save as BMP" ignores changes which are + not made with a mouse + + bgo#610478: Layer preview suddenly stops getting updated + + bgo#609026: leaks shared memory + + bgo#609056: Exporting to Alias PIX format fails + are always in English + + bgo#607242: GIMP 2.7.0 fails to build against libpng 1.4.0 + + bgo#606372: Saving to .ppm fails on indexed colorspace + + bgo#604508: gimp-layer-new-from-visible should work from + updated projection + + Fix crashes: bgo#600112, bgo#565001, bgo#604820, bgo#603711 + + Other fixes: bgo#622234, bgo#622196, bgo#608188, bgo#605237 + + Updated translations. +- Drop gimp-new-libpng.patch and gimp-fix-statusbar.patch, both + came from upstream git and are now included. + +------------------------------------------------------------------- +Mon Jun 14 12:05:43 CEST 2010 - vuntz@opensuse.org + +- Ship the openSUSE palette so that it's available in GIMP. + +------------------------------------------------------------------- +Sun May 23 19:41:18 CEST 2010 - vuntz@opensuse.org + +- Add gimp-fix-statusbar.patch to fix missing widgets in status + bar. Fix bnc#601712. + +------------------------------------------------------------------- +Sun May 23 16:16:03 CEST 2010 - vuntz@opensuse.org + +- Move the input device module to a specific package, to isolate + the HAL dependency. Fix bnc#601947. + ++++ 910 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:12.1:Update/.gimp.817.new/gimp.changes New: ---- baselibs.conf bnc#724628-0001-file-gif-load-limit-len-and-height-CVE-2012-3481.patch bnc#724628-0002-file-gif-load-fix-type-overflow-CVE-2012-3481.patch bnc#763595-gimp-fix-script-fu-buf-overflow-leak.patch bnc#769565-gimp-NULL-ptr-crash-in-fit-format-handler.patch bnc#775433-01-file-cel-check-fread-g_fopen-return-values-and-pass-.patch bnc#775433-02-file-cel-validate-header-data-CVE-2012-3403.patch bnc#775433-03-file-cel-use-statically-allocated-palette-buffer.patch bnc#775433-04-file-cel-use-g_set_error-for-errors-instead-of-g_mes.patch bnc#775433-05-file-cel-close-file-on-error.patch gimp-2.6.11.tar.bz2 gimp-CVE-2010-4540-and-more.patch gimp-CVE-2010-4543.patch gimp-CVE-2011-2896.patch gimp-fix-linking.patch gimp-poppler-0.18.patch gimp-pyslice-cellspacing-fix.patch gimp.changes gimp.spec macros.gimp openSUSE.gpl ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gimp.spec ++++++ # # spec file for package gimp # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # 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 http://bugs.opensuse.org/ # %define build_hal 0%{?suse_version} <= 1140 %global abiver 4 %global apiver 2.0 Name: gimp BuildRequires: aalib-devel BuildRequires: alsa-devel BuildRequires: babl-devel BuildRequires: cairo-devel BuildRequires: dbus-1-glib-devel BuildRequires: fontconfig-devel BuildRequires: gegl-devel BuildRequires: glib2-devel BuildRequires: gtk2-devel %if %{build_hal} BuildRequires: hal-devel %endif BuildRequires: intltool BuildRequires: iso-codes-devel BuildRequires: libexif-devel BuildRequires: liblcms-devel BuildRequires: libmng-devel BuildRequires: libpng-devel BuildRequires: libpoppler-glib-devel BuildRequires: librsvg-devel BuildRequires: libtiff-devel BuildRequires: libtool BuildRequires: libwebkit-devel BuildRequires: libwmf-devel BuildRequires: pango-devel BuildRequires: python-gtk-devel BuildRequires: translation-update-upstream BuildRequires: update-desktop-files BuildRequires: xorg-x11-libXfixes-devel Url: http://www.gimp.org/ Version: 2.6.11 Release: 0 Summary: The GNU Image Manipulation Program License: GPL-2.0+ Group: Productivity/Graphics/Bitmap Editors Source: ftp://ftp.gimp.org/pub/gimp/v2.6/%{name}-%{version}.tar.bz2 Source1: macros.gimp # openSUSE palette file Source2: openSUSE.gpl Source99: baselibs.conf # PATCH-FIX-UPSTREAM gimp-CVE-2010-4540-and-more.patch CVE-2010-4540 CVE-2010-4541 CVE-2010-4542 bgo#639203 bnc#662043 vuntz@opensuse.org -- Fix various buffer overflows Patch0: gimp-CVE-2010-4540-and-more.patch # PATCH-FIX-UPSTREAM gimp-CVE-2010-4543.patch CVE-2010-4543 bgo#639203 bnc#662043 vuntz@opensuse.org -- Fix a buffer overflow when reading a psp file Patch1: gimp-CVE-2010-4543.patch # PATCH-FIX-UPSTREAM gimp-fix-linking.patch bgo#659586 vuntz@opensuse.org -- Fix linking issue because of missing libs Patch2: gimp-fix-linking.patch # PATCH-FIX-UPSTREAM gimp-CVE-2011-2896.patch CVE-2011-2896 bnc#711491 vuntz@opensuse.org -- Fix heap corruption and buffer overflow Patch3: gimp-CVE-2011-2896.patch # PATCH-FIX-UPSTREAM gimp-pyslice-cellspacing-fix.patch vuntz@opensuse.org -- Fix pyslice to not crash Patch4: gimp-pyslice-cellspacing-fix.patch # PATCH-FIX-UPSTREAM gimp-poppler-0.18.patch vuntz@opensuse.org -- Fix build with poppler 0.18, taken from fedora Patch5: gimp-poppler-0.18.patch # Patches to fix bnc#775433 Patch6: bnc#775433-01-file-cel-check-fread-g_fopen-return-values-and-pass-.patch Patch7: bnc#775433-02-file-cel-validate-header-data-CVE-2012-3403.patch Patch8: bnc#775433-03-file-cel-use-statically-allocated-palette-buffer.patch Patch9: bnc#775433-04-file-cel-use-g_set_error-for-errors-instead-of-g_mes.patch Patch10: bnc#775433-05-file-cel-close-file-on-error.patch # Patches to fix bnc#724628 Patch11: bnc#724628-0001-file-gif-load-limit-len-and-height-CVE-2012-3481.patch Patch12: bnc#724628-0002-file-gif-load-fix-type-overflow-CVE-2012-3481.patch # Patch to fix bnc#763595 Patch13: bnc#763595-gimp-fix-script-fu-buf-overflow-leak.patch # Patch to fix bnc#769565 Patch14: bnc#769565-gimp-NULL-ptr-crash-in-fit-format-handler.patch Requires: %{name}-branding = %{version} Recommends: %{name}-lang Recommends: %{name}-help-browser Recommends: %{name}-plugins-python = %{version} Recommends: iso-codes Suggests: AdobeICCProfiles Suggests: gimp-2.0-scanner-plugin Provides: gimp-2.0 = %{version} Provides: gimp(abi) = %{abiver} Provides: gimp(api) = %{apiver} Obsoletes: gimp-unstable < 2.6.0 %if ! %{build_hal} # Obsolete hal subpackage which we had until 11.4. Obsoletes: %{name}-module-hal <= %{version} %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. %package -n libgimp-2_0-0 Summary: The GNU Image Manipulation Program - Libraries Group: Productivity/Graphics/Bitmap Editors %description -n libgimp-2_0-0 The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. This package provides GIMP libraries. %package -n libgimpui-2_0-0 Summary: The GNU Image Manipulation Program - UI Libraries Group: Productivity/Graphics/Bitmap Editors %description -n libgimpui-2_0-0 The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. This package provides GIMP UI libraries. %package branding-upstream Summary: The GNU Image Manipulation Program -- Upstream Splash Screen Group: Productivity/Graphics/Bitmap Editors Requires: %{name} = %{version} Provides: %{name}-branding = %{version} Conflicts: otherproviders(%{name}-branding) Obsoletes: gimp-unstable-branding-upstream < 2.6.0 Supplements: packageand(%{name}:branding-upstream) # It is technically compatible with 2.4, but upstream branding has version specific image: Conflicts: %{name} < 2.6.0 BuildArch: noarch ## WARNING WARNING WARNING: see warning in %files section #BRAND: /usr/share/gimp/2.0/images/gimp-splash.png is a splash screen in #BRAND: GIMP, original size is 300x400. Bottom part displays "just #BRAND: starting" text and progress bar. ## WARNING WARNING WARNING: see warning in %files section %description branding-upstream The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. This package contains the upstream splash screen for the GIMP. %package plugins-python Summary: The GNU Image Manipulation Program - python-gtk based plugins Group: Productivity/Graphics/Bitmap Editors Requires: %{name} = %{version} Requires: python-gtk Supplements: %{name} Provides: gimp-2.0-plugins-python = %{version} Obsoletes: gimp-unstable-plugins-python < 2.6.0 # For update from <= 10.3 and SLED 10: Provides: %{name}:%{_libdir}/gimp/2.0/plug-ins/pyconsole.py = %{version} %py_requires %description plugins-python The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. %package devel Summary: The GNU Image Manipulation Program Group: Productivity/Graphics/Bitmap Editors Requires: libgimp-2_0-0 = %{version} Requires: libgimpui-2_0-0 = %{version} Provides: gimp-2.0-devel = %{version} Obsoletes: gimp-doc <= 2.6.4 Obsoletes: gimp-unstable-devel < 2.6.0 Provides: gimp-doc = 2.6.4 %description devel The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. %package help-browser Summary: The GNU Image Manipulation Program - Help Browser Group: Productivity/Graphics/Bitmap Editors Requires: %{name} = %{version} Supplements: packageand(%{name}:gimp-help) %description help-browser This package contains the help browser for the GIMP. %if %{build_hal} %package module-hal Summary: The GNU Image Manipulation Program - module to detect input devices with HAL Group: Productivity/Graphics/Bitmap Editors Requires: %{name} = %{version} Supplements: packageand(%{name}:hal) %description module-hal The GIMP (GNU Image Manipulation Program) is a powerful image composition and editing program, which can be extremely useful for creating logos and other graphics for Web pages. The GIMP offers many of the tools and filters you would expect to find in similar commercial offerings and contains some interesting extras as well. The GIMP provides a large image manipulation toolbox, including channel operations and layers, effects, subpixel imaging and antialiasing, and conversions- all including multilevel undo. The GIMP offers a scripting facility, but many of the included scripts rely on fonts that we cannot distribute. This package provides a module to detect input devices with HAL. %endif %lang_package %prep %setup -q translation-update-upstream translation-update-upstream po-libgimp gimp20-libgimp translation-update-upstream po-python gimp20-python translation-update-upstream po-script-fu gimp20-script-fu translation-update-upstream po-plug-ins gimp20-std-plug-ins translation-update-upstream po-tips gimp20-tips %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 # Safety check for ABI version change. vabi=`printf "%d" $(sed -n '/#define GIMP_MODULE_ABI_VERSION/{s/.* //;p}' libgimpmodule/gimpmodule.h)` if test "x${vabi}" != "x%{abiver}"; then : Error: Upstream ABI version is now ${vabi}, expecting %{abiver}. : Update the apiver macro and rebuild. exit 1 fi # Safety check for API version change. vapi=`sed -n '/#define GIMP_API_VERSION/{s/.* //;p}' libgimpbase/gimpversion.h | sed -e 's@"@@g'` if test "x${vapi}" != "x%{apiver}"; then : Error: Upstream API version is now ${vapi}, expecting %{apiver}. : Update the apiver macro and rebuild. exit 1 fi %build # needed for patch2 autoreconf -fi export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure --with-pic\ --disable-static\ --libexecdir=%{_prefix}/lib\ --enable-default-binary\ --enable-mp make %{?jobs:-j%jobs} %install %makeinstall install -D -m 0644 %{S:2} %{buildroot}%{_datadir}/gimp/2.0/palettes %suse_update_desktop_file -N GIMP gimp rm $RPM_BUILD_ROOT%{_libdir}/gimp/2.0/*/*.*a %find_lang gimp20 %{?no_lang_C} %find_lang gimp20-libgimp %{?no_lang_C} gimp20.lang %find_lang gimp20-python %{?no_lang_C} gimp20.lang %find_lang gimp20-script-fu %{?no_lang_C} gimp20.lang %find_lang gimp20-std-plug-ins %{?no_lang_C} gimp20.lang %find_lang gimp20-tips %{?no_lang_C} gimp20.lang echo "%%defattr(-,root,root)" >plugins.list echo "%%defattr(-,root,root)" >plugins-python.list for PLUGIN in $RPM_BUILD_ROOT%{_libdir}/gimp/2.0/plug-ins/* ; do if grep -q '^#!.*python' $PLUGIN ; then echo "${PLUGIN#$RPM_BUILD_ROOT}" >>plugins-python.list else echo "${PLUGIN#$RPM_BUILD_ROOT}" >>plugins.list fi done rm %{buildroot}%{_libdir}/*.la # Install the macros file: install -d $RPM_BUILD_ROOT%{_sysconfdir}/rpm sed -e "s/@GIMP_APIVER@/%{apiver}/;s/@GIMP_ABIVER@/%{abiver}/" \ < $RPM_SOURCE_DIR/macros.gimp > macros.gimp install -m 644 -c macros.gimp \ $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.gimp %if 0%{?suse_version} > 1130 %post %desktop_database_post %icon_theme_cache_post %endif %if 0%{?suse_version} > 1130 %postun %desktop_database_postun %icon_theme_cache_postun %endif %post -n libgimp-2_0-0 -p /sbin/ldconfig %postun -n libgimp-2_0-0 -p /sbin/ldconfig %post -n libgimpui-2_0-0 -p /sbin/ldconfig %postun -n libgimpui-2_0-0 -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT %files -f plugins.list %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog LICENSE NEWS* README %exclude %{_libdir}/gimp/2.0/plug-ins/help-browser %{_bindir}/gimp %{_bindir}/gimp-2.? %{_bindir}/gimp-console %{_bindir}/gimp-console-2.? %{_datadir}/applications/gimp.desktop %{_datadir}/icons/hicolor/*/apps/*.png %{_datadir}/icons/hicolor/*/apps/*.svg %{_datadir}/gimp/ %exclude %{_datadir}/gimp/2.0/images/gimp-splash.png %{_libdir}/gimp/2.0/environ/default.env %{_libdir}/gimp/2.0/interpreters/default.interp %{_libdir}/gimp/2.0/modules/*.so %if %{build_hal} %exclude %{_libdir}/gimp/2.0/modules/libcontroller-linux-input.so %endif %doc %{_mandir}/man?/gimp.* %doc %{_mandir}/man?/gimp-2.?.* %doc %{_mandir}/man?/gimp-console.* %doc %{_mandir}/man?/gimp-console-2.?.* %doc %{_mandir}/man?/gimprc.* %doc %{_mandir}/man?/gimprc-2.?.* %dir %{_sysconfdir}/gimp %dir %{_sysconfdir}/gimp/2.0 %config %{_sysconfdir}/gimp/2.0/*rc %files -n libgimp-2_0-0 %defattr(-,root,root) %dir %{_datadir}/gimp %dir %{_datadir}/gimp/2.0 %dir %{_libdir}/gimp %dir %{_libdir}/gimp/2.0 %dir %{_libdir}/gimp/2.0/environ %dir %{_libdir}/gimp/2.0/interpreters %dir %{_libdir}/gimp/2.0/modules %dir %{_libdir}/gimp/2.0/plug-ins %{_libdir}/libgimp-2.0.so.* %{_libdir}/libgimpbase-2.0.so.* %{_libdir}/libgimpcolor-2.0.so.* %{_libdir}/libgimpconfig-2.0.so.* %{_libdir}/libgimpmath-2.0.so.* %{_libdir}/libgimpmodule-2.0.so.* %files -n libgimpui-2_0-0 %defattr(-,root,root) %{_libdir}/libgimpthumb-2.0.so.* %{_libdir}/libgimpui-2.0.so.* %{_libdir}/libgimpwidgets-2.0.so.* %files help-browser %defattr(-,root,root) %doc AUTHORS COPYING ChangeLog LICENSE NEWS* README %{_libdir}/gimp/2.0/plug-ins/help-browser %files branding-upstream %defattr(-,root,root) ## WARNING WARNING WARNING: if we change the branding package to contain other # files than the splash, and this means the branding package should have a real # strict dependency on the gimp version, then branding-openSUSE should be # changed. Right now it only has an unversioned Requires for the gimp. %{_datadir}/gimp/2.0/images/gimp-splash.png %files plugins-python -f plugins-python.list %defattr(-,root,root) %{_libdir}/gimp/2.0/environ/pygimp.env %{_libdir}/gimp/2.0/interpreters/pygimp.interp %{_libdir}/gimp/2.0/python/ # FIXME: Maybe split gimp-lang and gimp-plugins-python-lang %if %{build_hal} %files module-hal %defattr(-,root,root) %{_libdir}/gimp/2.0/modules/libcontroller-linux-input.so %endif %files lang -f gimp20.lang %files devel %defattr(-,root,root) %doc README.i18n %{_bindir}/gimptool-2.0 %doc %{_mandir}/man?/gimptool-2.0.* %{_datadir}/aclocal/*.m4 %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/*.pc # Own these repositories to not depend on gtk-doc while building: %dir %{_datadir}/gtk-doc %dir %{_datadir}/gtk-doc/html %{_datadir}/gtk-doc/html/* %config %{_sysconfdir}/rpm/macros.gimp %changelog ++++++ baselibs.conf ++++++ libgimp-2_0-0 libgimpui-2_0-0 ++++++ bnc#724628-0001-file-gif-load-limit-len-and-height-CVE-2012-3481.patch ++++++
From 4ec417c50d4cce935a87b5beab051e85cbfcec45 Mon Sep 17 00:00:00 2001 From: Jan Lieskovsky <jlieskov@redhat.com> Date: Tue, 14 Aug 2012 12:18:22 +0200 Subject: [PATCH 1/2] file-gif-load: limit len and height (CVE-2012-3481)
Ensure values of len and height can't overflow g_malloc() argument type. --- plug-ins/common/file-gif-load.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c index 9a0720b..909b184 100644 --- a/plug-ins/common/file-gif-load.c +++ b/plug-ins/common/file-gif-load.c @@ -1025,6 +1025,13 @@ ReadImage (FILE *fd, cur_progress = 0; max_progress = height; + if (len > (G_MAXSIZE / height / (alpha_frame ? (promote_to_rgb ? 4 : 2) : 1))) + { + g_message ("'%s' has a larger image size than GIMP can handle.", + gimp_filename_to_utf8 (filename)); + return -1; + } + if (alpha_frame) dest = (guchar *) g_malloc (len * height * (promote_to_rgb ? 4 : 2)); else -- 1.7.11.4 ++++++ bnc#724628-0002-file-gif-load-fix-type-overflow-CVE-2012-3481.patch ++++++
From 407606bdbb404c0a1bf14751a394459e1bedfc08 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Tue, 14 Aug 2012 15:27:39 +0200 Subject: [PATCH 2/2] file-gif-load: fix type overflow (CVE-2012-3481)
Cast variables properly to avoid overflowing when computing how much memory to allocate. --- plug-ins/common/file-gif-load.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c index 909b184..b46ba08 100644 --- a/plug-ins/common/file-gif-load.c +++ b/plug-ins/common/file-gif-load.c @@ -1033,9 +1033,9 @@ ReadImage (FILE *fd, } if (alpha_frame) - dest = (guchar *) g_malloc (len * height * (promote_to_rgb ? 4 : 2)); + dest = (guchar *) g_malloc ((gsize)len * (gsize)height * (promote_to_rgb ? 4 : 2)); else - dest = (guchar *) g_malloc (len * height); + dest = (guchar *) g_malloc ((gsize)len * (gsize)height); #ifdef GIFDEBUG g_print ("GIF: reading %d by %d%s GIF image, ncols=%d\n", -- 1.7.11.4 ++++++ bnc#763595-gimp-fix-script-fu-buf-overflow-leak.patch ++++++ Index: gimp-2.6.11/plug-ins/script-fu/tinyscheme/scheme.c =================================================================== --- gimp-2.6.11.orig/plug-ins/script-fu/tinyscheme/scheme.c +++ gimp-2.6.11/plug-ins/script-fu/tinyscheme/scheme.c @@ -1708,35 +1708,16 @@ INTERFACE void putstr(scheme *sc, const /* read characters up to delimiter, but cater to character constants */ static char *readstr_upto(scheme *sc, char *delim) { char *p = sc->strbuff; - gunichar c = 0; - gunichar c_prev = 0; - int len = 0; -#if 0 - while (!is_one_of(delim, (*p++ = inchar(sc)))) - ; - if(p==sc->strbuff+2 && p[-2]=='\\') { + while ((p - sc->strbuff < sizeof(sc->strbuff)) && + !is_one_of(delim, (*p++ = inchar(sc)))); + + if(p == sc->strbuff+2 && p[-2] == '\\') { *p=0; } else { backchar(sc,p[-1]); *--p = '\0'; } -#else - do { - c_prev = c; - c = inchar(sc); - len = g_unichar_to_utf8(c, p); - p += len; - } while (c && !is_one_of(delim, c)); - - if(p==sc->strbuff+2 && c_prev=='\\') - *p = '\0'; - else - { - backchar(sc,c); /* put back the delimiter */ - p[-len] = '\0'; - } -#endif return sc->strbuff; } ++++++ bnc#769565-gimp-NULL-ptr-crash-in-fit-format-handler.patch ++++++ Index: gimp-2.6.11/plug-ins/file-fits/fits-io.c =================================================================== --- gimp-2.6.11.orig/plug-ins/file-fits/fits-io.c +++ gimp-2.6.11/plug-ins/file-fits/fits-io.c @@ -1057,7 +1057,16 @@ static FITS_HDU_LIST *fits_decode_header if (hdulist->used.xtension) { fdat = fits_decode_card (fits_search_card (hdr, "XTENSION"), typ_fstring); - strcpy (hdulist->xtension, fdat->fstring); + + if(fdat != NULL) + { + strcpy (hdulist->xtension, fdat->fstring); + } + else + { + strcpy (errmsg, "No valid XTENSION header found."); + goto err_return; + } } FITS_DECODE_CARD (hdr, "NAXIS", fdat, typ_flong); ++++++ bnc#775433-01-file-cel-check-fread-g_fopen-return-values-and-pass-.patch ++++++
From 59c460bb33fbc5fd9d54efc2ecb94bfe0e7b8c40 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Thu, 12 Jul 2012 15:50:02 +0200 Subject: [PATCH 1/5] file-cel: check fread()/g_fopen() return values and pass on errors (cherry picked from commit 9b2b8999497c28a4f9152c6d1bc85219d5fdd845)
From 6a462eb46b646b7755003bf7678a35e1178318ec Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Fri, 13 Jul 2012 15:20:06 +0200 Subject: [PATCH 2/5] file-cel: validate header data (CVE-2012-3403) (cherry
--- plug-ins/common/file-cel.c | 190 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 160 insertions(+), 30 deletions(-) diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index a94671c..83226d4 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -44,8 +44,10 @@ static void run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals); -static gint load_palette (FILE *fp, - guchar palette[]); +static gint load_palette (const gchar *file, + FILE *fp, + guchar palette[], + GError **error); static gint32 load_image (const gchar *file, const gchar *brief, GError **error); @@ -55,7 +57,8 @@ static gboolean save_image (const gchar *file, gint32 layer, GError **error); static void palette_dialog (const gchar *title); -static gboolean need_palette (const gchar *file); +static gboolean need_palette (const gchar *file, + GError **error); /* Globals... */ @@ -150,6 +153,7 @@ run (const gchar *name, gint32 image; GimpExportReturn export = GIMP_EXPORT_CANCEL; GError *error = NULL; + gint needs_palette = 0; run_mode = param[0].data.d_int32; @@ -187,20 +191,32 @@ run (const gchar *name, else if (run_mode == GIMP_RUN_INTERACTIVE) { /* Let user choose KCF palette (cancel ignores) */ - if (need_palette (param[1].data.d_string)) - palette_dialog (_("Load KISS Palette")); + needs_palette = need_palette (param[1].data.d_string, &error); - gimp_set_data (SAVE_PROC, palette_file, data_length); - } + if (! error) + { + if (needs_palette) + palette_dialog (_("Load KISS Palette")); - image = load_image (param[1].data.d_string, param[2].data.d_string, - &error); + gimp_set_data (SAVE_PROC, palette_file, data_length); + } + } - if (image != -1) + if (! error) { - *nreturn_vals = 2; - values[1].type = GIMP_PDB_IMAGE; - values[1].data.d_image = image; + image = load_image (param[1].data.d_string, param[2].data.d_string, + &error); + + if (image != -1) + { + *nreturn_vals = 2; + values[1].type = GIMP_PDB_IMAGE; + values[1].data.d_image = image; + } + else + { + status = GIMP_PDB_EXECUTION_ERROR; + } } else { @@ -263,18 +279,33 @@ run (const gchar *name, /* Peek into the file to determine whether we need a palette */ static gboolean -need_palette (const gchar *file) +need_palette (const gchar *file, + GError **error) { FILE *fp; guchar header[32]; + size_t n_read; fp = g_fopen (file, "rb"); - if (!fp) - return FALSE; + if (fp == NULL) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), + _("Could not open '%s' for reading: %s"), + gimp_filename_to_utf8 (file), g_strerror (errno)); + return FALSE; + } + + n_read = fread (header, 32, 1, fp); - fread (header, 32, 1, fp); fclose (fp); + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image header")); + return FALSE; + } + return (header[5] < 32); } @@ -301,6 +332,7 @@ load_image (const gchar *file, GimpPixelRgn pixel_rgn; /* Pixel region for layer */ gint i, j, k; /* Counters */ + size_t n_read; /* Number of items read from file */ /* Open the file for reading */ @@ -319,7 +351,14 @@ load_image (const gchar *file, /* Get the image dimensions and create the image... */ - fread (header, 4, 1, fp); + n_read = fread (header, 4, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image header")); + return -1; + } if (strncmp ((const gchar *) header, "KiSS", 4)) { @@ -332,7 +371,15 @@ load_image (const gchar *file, } else { /* New-style image file, read full header */ - fread (header, 28, 1, fp); + n_read = fread (header, 28, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image header")); + return -1; + } + bpp = header[1]; if (bpp == 24) colours = -1; @@ -383,7 +430,15 @@ load_image (const gchar *file, switch (bpp) { case 4: - fread (buffer, (width+1)/2, 1, fp); + n_read = fread (buffer, (width+1)/2, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image data")); + return -1; + } + for (j = 0, k = 0; j < width*2; j+= 4, ++k) { if (buffer[k] / 16 == 0) @@ -410,7 +465,15 @@ load_image (const gchar *file, break; case 8: - fread (buffer, width, 1, fp); + n_read = fread (buffer, width, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image data")); + return -1; + } + for (j = 0, k = 0; j < width*2; j+= 2, ++k) { if (buffer[k] == 0) @@ -427,7 +490,15 @@ load_image (const gchar *file, break; case 32: - fread (line, width*4, 1, fp); + n_read = fread (line, width*4, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("EOF or error while reading image data")); + return -1; + } + /* The CEL file order is BGR so we need to swap B and R * to get the Gimp RGB order. */ @@ -467,12 +538,23 @@ load_image (const gchar *file, else { fp = g_fopen (palette_file, "r"); + + if (fp == NULL) + { + g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno), + _("Could not open '%s' for reading: %s"), + gimp_filename_to_utf8 (palette_file), + g_strerror (errno)); + return -1; + } } if (fp != NULL) { - colours = load_palette (fp, palette); + colours = load_palette (palette_file, fp, palette, error); fclose (fp); + if (colours < 0) + return -1; } else { @@ -498,24 +580,55 @@ load_image (const gchar *file, } static gint -load_palette (FILE *fp, - guchar palette[]) +load_palette (const gchar *file, + FILE *fp, + guchar palette[], + GError **error) { guchar header[32]; /* File header */ guchar buffer[2]; int i, bpp, colours= 0; + size_t n_read; + + n_read = fread (header, 4, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': EOF or error while reading palette header"), + gimp_filename_to_utf8 (file)); + return -1; + } - fread (header, 4, 1, fp); if (!strncmp ((const gchar *) header, "KiSS", 4)) { - fread (header+4, 28, 1, fp); + n_read = fread (header+4, 28, 1, fp); + + if (n_read < 1) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': EOF or error while reading palette header"), + gimp_filename_to_utf8 (file)); + return -1; + } + bpp = header[5]; colours = header[8] + header[9] * 256; if (bpp == 12) { for (i = 0; i < colours; ++i) { - fread (buffer, 1, 2, fp); + n_read = fread (buffer, 1, 2, fp); + + if (n_read < 2) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': EOF or error while reading " + "palette data"), + gimp_filename_to_utf8 (file)); + return -1; + } + palette[i*3]= buffer[0] & 0xf0; palette[i*3+1]= (buffer[1] & 0x0f) * 16; palette[i*3+2]= (buffer[0] & 0x0f) * 16; @@ -523,7 +636,15 @@ load_palette (FILE *fp, } else { - fread (palette, colours, 3, fp); + n_read = fread (palette, colours, 3, fp); + + if (n_read < 3) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': EOF or error while reading palette data"), + gimp_filename_to_utf8 (file)); + return -1; + } } } else @@ -532,7 +653,16 @@ load_palette (FILE *fp, fseek (fp, 0, SEEK_SET); for (i= 0; i < colours; ++i) { - fread (buffer, 1, 2, fp); + n_read = fread (buffer, 1, 2, fp); + + if (n_read < 2) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': EOF or error while reading palette data"), + gimp_filename_to_utf8 (file)); + return -1; + } + palette[i*3] = buffer[0] & 0xf0; palette[i*3+1] = (buffer[1] & 0x0f) * 16; palette[i*3+2] = (buffer[0] & 0x0f) * 16; -- 1.7.10.4 ++++++ bnc#775433-02-file-cel-validate-header-data-CVE-2012-3403.patch ++++++ picked from commit 50c81019ade3084ec77e2e3cd848ba51d9845a97) --- plug-ins/common/file-cel.c | 83 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 13 deletions(-) diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index 83226d4..95fbe6c 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -317,11 +317,12 @@ load_image (const gchar *file, GError **error) { FILE *fp; /* Read file pointer */ - guchar header[32]; /* File header */ + guchar header[32], /* File header */ + file_mark, /* KiSS file type */ + bpp; /* Bits per pixel */ gint height, width, /* Dimensions of image */ offx, offy, /* Layer offets */ - colours, /* Number of colours */ - bpp; /* Bits per pixel */ + colours; /* Number of colours */ gint32 image, /* Image */ layer; /* Layer */ @@ -380,17 +381,44 @@ load_image (const gchar *file, return -1; } + file_mark = header[0]; + if (file_mark != 0x20 && file_mark != 0x21) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("is not a CEL image file")); + return -1; + } + bpp = header[1]; - if (bpp == 24) - colours = -1; - else - colours = (1 << header[1]); + switch (bpp) + { + case 4: + case 8: + case 32: + colours = (1 << bpp); + break; + default: + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("illegal bpp value in image: %hhu"), bpp); + return -1; + } + width = header[4] + (256 * header[5]); height = header[6] + (256 * header[7]); offx = header[8] + (256 * header[9]); offy = header[10] + (256 * header[11]); } + if ((width == 0) || (height == 0) || (width + offx > GIMP_MAX_IMAGE_SIZE) || + (height + offy > GIMP_MAX_IMAGE_SIZE)) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("illegal image dimensions: width: %d, horizontal offset: " + "%d, height: %d, vertical offset: %d"), + width, offx, height, offy); + return -1; + } + if (bpp == 32) image = gimp_image_new (width + offx, height + offy, GIMP_RGB); else @@ -553,7 +581,7 @@ load_image (const gchar *file, { colours = load_palette (palette_file, fp, palette, error); fclose (fp); - if (colours < 0) + if (colours < 0 || *error) return -1; } else @@ -587,7 +615,8 @@ load_palette (const gchar *file, { guchar header[32]; /* File header */ guchar buffer[2]; - int i, bpp, colours= 0; + guchar file_mark, bpp; + gint i, colours = 0; size_t n_read; n_read = fread (header, 4, 1, fp); @@ -612,10 +641,36 @@ load_palette (const gchar *file, return -1; } + file_mark = header[4]; + if (file_mark != 0x10) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': is not a KCF palette file"), + gimp_filename_to_utf8 (file)); + return -1; + } + bpp = header[5]; + if (bpp != 12 && bpp != 24) + { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': illegal bpp value in palette: %hhu"), + gimp_filename_to_utf8 (file), bpp); + return -1; + } + colours = header[8] + header[9] * 256; - if (bpp == 12) + if (colours != 16 && colours != 256) { + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("'%s': illegal number of colors: %u"), + gimp_filename_to_utf8 (file), colours); + return -1; + } + + switch (bpp) + { + case 12: for (i = 0; i < colours; ++i) { n_read = fread (buffer, 1, 2, fp); @@ -633,9 +688,8 @@ load_palette (const gchar *file, palette[i*3+1]= (buffer[1] & 0x0f) * 16; palette[i*3+2]= (buffer[0] & 0x0f) * 16; } - } - else - { + break; + case 24: n_read = fread (palette, colours, 3, fp); if (n_read < 3) @@ -645,6 +699,9 @@ load_palette (const gchar *file, gimp_filename_to_utf8 (file)); return -1; } + break; + default: + g_assert_not_reached (); } } else -- 1.7.10.4 ++++++ bnc#775433-03-file-cel-use-statically-allocated-palette-buffer.patch ++++++
From 720eb49d14987c84bd792f9e185ec95160c2e309 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Fri, 13 Jul 2012 15:30:44 +0200 Subject: [PATCH 3/5] file-cel: use statically allocated palette buffer (cherry picked from commit dbf2538d68f2d3194fb12c14fc713ec7836cd59a)
--- plug-ins/common/file-cel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index 95fbe6c..8e82ff7 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -556,7 +556,7 @@ load_image (const gchar *file, if (bpp != 32) { /* Use palette from file or otherwise default grey palette */ - palette = g_new (guchar, colours*3); + guchar palette[256*3]; /* Open the file for reading if user picked one */ if (palette_file == NULL) @@ -593,10 +593,6 @@ load_image (const gchar *file, } gimp_image_set_colormap (image, palette + 3, colours - 1); - - /* Close palette file, give back allocated memory */ - - g_free (palette); } /* Now get everything redrawn and hand back the finished image */ -- 1.7.10.4 ++++++ bnc#775433-04-file-cel-use-g_set_error-for-errors-instead-of-g_mes.patch ++++++
From 476f7870182ae6b27027cae7166ce780f2444e61 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Fri, 13 Jul 2012 15:33:27 +0200 Subject: [PATCH 4/5] file-cel: use g_set_error() for errors instead of g_message() (cherry picked from commit a3b486d952664a6f9b98f7fb8f59042df79f59ef)
Conflicts: plug-ins/common/file-cel.c --- plug-ins/common/file-cel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index 8e82ff7..39d2d7b 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -426,7 +426,7 @@ load_image (const gchar *file, if (image == -1) { - g_message (_("Can't create a new image")); + g_set_error (error, 0, 0, _("Can't create a new image")); return -1; } @@ -539,7 +539,8 @@ load_image (const gchar *file, break; default: - g_message (_("Unsupported bit depth (%d)!"), bpp); + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, + _("Unsupported bit depth (%d)!"), bpp); return -1; } -- 1.7.10.4 ++++++ bnc#775433-05-file-cel-close-file-on-error.patch ++++++
From 49c1af36b360ba85c86f71509fcba77eef7c6f22 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Fri, 13 Jul 2012 15:47:16 +0200 Subject: [PATCH 5/5] file-cel: close file on error
--- plug-ins/common/file-cel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plug-ins/common/file-cel.c b/plug-ins/common/file-cel.c index 39d2d7b..3357561 100644 --- a/plug-ins/common/file-cel.c +++ b/plug-ins/common/file-cel.c @@ -427,6 +427,7 @@ load_image (const gchar *file, if (image == -1) { g_set_error (error, 0, 0, _("Can't create a new image")); + fclose (fp); return -1; } -- 1.7.10.4 ++++++ gimp-CVE-2010-4540-and-more.patch ++++++
From 7fb0300e1cfdb98a3bde54dbc73a0f3eda375162 Mon Sep 17 00:00:00 2001 From: Simon Budig <simon@budig.de> Date: Tue, 11 Jan 2011 22:28:16 +0000 Subject: fixes for some buffer overflow problems (see bug #639203)
--- diff --git a/plug-ins/common/sphere-designer.c b/plug-ins/common/sphere-designer.c index 4e5b982..6dea871 100644 --- a/plug-ins/common/sphere-designer.c +++ b/plug-ins/common/sphere-designer.c @@ -1993,6 +1993,7 @@ loadit (const gchar * fn) gchar endbuf[21 * (G_ASCII_DTOSTR_BUF_SIZE + 1)]; gchar *end = endbuf; gchar line[1024]; + gchar fmt_str[16]; gint i; texture *t; gint majtype, type; @@ -2017,6 +2018,8 @@ loadit (const gchar * fn) s.com.numtexture = 0; + snprintf (fmt_str, sizeof (fmt_str), "%%d %%d %%%lds", sizeof (endbuf) - 1); + while (!feof (f)) { @@ -2027,7 +2030,7 @@ loadit (const gchar * fn) t = &s.com.texture[i]; setdefaults (t); - if (sscanf (line, "%d %d %s", &t->majtype, &t->type, end) != 3) + if (sscanf (line, fmt_str, &t->majtype, &t->type, end) != 3) t->color1.x = g_ascii_strtod (end, &end); if (end && errno != ERANGE) t->color1.y = g_ascii_strtod (end, &end); diff --git a/plug-ins/gfig/gfig-style.c b/plug-ins/gfig/gfig-style.c index ee1c7b2..eae78f8 100644 --- a/plug-ins/gfig/gfig-style.c +++ b/plug-ins/gfig/gfig-style.c @@ -164,6 +164,7 @@ gfig_read_parameter_gimp_rgb (gchar **text, gchar *ptr; gchar *tmpstr; gchar *endptr; + gchar fmt_str[32]; gchar colorstr_r[G_ASCII_DTOSTR_BUF_SIZE]; gchar colorstr_g[G_ASCII_DTOSTR_BUF_SIZE]; gchar colorstr_b[G_ASCII_DTOSTR_BUF_SIZE]; @@ -171,6 +172,10 @@ gfig_read_parameter_gimp_rgb (gchar **text, style_entry->r = style_entry->g = style_entry->b = style_entry->a = 0.; + snprintf (fmt_str, sizeof (fmt_str), "%%%lds %%%lds %%%lds %%%lds", + sizeof (colorstr_r) - 1, sizeof (colorstr_g) - 1, + sizeof (colorstr_b) - 1, sizeof (colorstr_a) - 1); + while (n < nitems) { ptr = strchr (text[n], ':'); @@ -180,7 +185,8 @@ gfig_read_parameter_gimp_rgb (gchar **text, ptr++; if (!strcmp (tmpstr, name)) { - sscanf (ptr, "%s %s %s %s", colorstr_r, colorstr_g, colorstr_b, colorstr_a); + sscanf (ptr, fmt_str, + colorstr_r, colorstr_g, colorstr_b, colorstr_a); style_entry->r = g_ascii_strtod (colorstr_r, &endptr); style_entry->g = g_ascii_strtod (colorstr_g, &endptr); style_entry->b = g_ascii_strtod (colorstr_b, &endptr); diff --git a/plug-ins/lighting/lighting-ui.c b/plug-ins/lighting/lighting-ui.c index 99fb348..126f6e2 100644 --- a/plug-ins/lighting/lighting-ui.c +++ b/plug-ins/lighting/lighting-ui.c @@ -1345,6 +1345,7 @@ load_preset_response (GtkFileChooser *chooser, gchar buffer3[G_ASCII_DTOSTR_BUF_SIZE]; gchar type_label[21]; gchar *endptr; + gchar fmt_str[32]; if (response_id == GTK_RESPONSE_OK) { @@ -1384,23 +1385,41 @@ load_preset_response (GtkFileChooser *chooser, return; } - fscanf (fp, " Position: %s %s %s", buffer1, buffer2, buffer3); + snprintf (fmt_str, sizeof (fmt_str), + " Position: %%%lds %%%lds %%%lds", + sizeof (buffer1) - 1, + sizeof (buffer2) - 1, + sizeof (buffer3) - 1); + fscanf (fp, fmt_str, buffer1, buffer2, buffer3); source->position.x = g_ascii_strtod (buffer1, &endptr); source->position.y = g_ascii_strtod (buffer2, &endptr); source->position.z = g_ascii_strtod (buffer3, &endptr); - fscanf (fp, " Direction: %s %s %s", buffer1, buffer2, buffer3); + snprintf (fmt_str, sizeof (fmt_str), + " Direction: %%%lds %%%lds %%%lds", + sizeof (buffer1) - 1, + sizeof (buffer2) - 1, + sizeof (buffer3) - 1); + fscanf (fp, fmt_str, buffer1, buffer2, buffer3); source->direction.x = g_ascii_strtod (buffer1, &endptr); source->direction.y = g_ascii_strtod (buffer2, &endptr); source->direction.z = g_ascii_strtod (buffer3, &endptr); - fscanf (fp, " Color: %s %s %s", buffer1, buffer2, buffer3); + snprintf (fmt_str, sizeof (fmt_str), + " Color: %%%lds %%%lds %%%lds", + sizeof (buffer1) - 1, + sizeof (buffer2) - 1, + sizeof (buffer3) - 1); + fscanf (fp, fmt_str, buffer1, buffer2, buffer3); source->color.r = g_ascii_strtod (buffer1, &endptr); source->color.g = g_ascii_strtod (buffer2, &endptr); source->color.b = g_ascii_strtod (buffer3, &endptr); source->color.a = 1.0; - fscanf (fp, " Intensity: %s", buffer1); + snprintf (fmt_str, sizeof (fmt_str), + " Intensity: %%%lds", + sizeof (buffer1) - 1); + fscanf (fp, fmt_str, buffer1); source->intensity = g_ascii_strtod (buffer1, &endptr); } -- cgit v0.8.3.1 ++++++ gimp-CVE-2010-4543.patch ++++++
From 48ec15890e1751dede061f6d1f469b6508c13439 Mon Sep 17 00:00:00 2001 From: Simon Budig <simon@budig.de> Date: Mon, 14 Feb 2011 20:46:31 +0000 Subject: file-psp: fix for bogus input data. Fixes bug #639203
--- diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c index ef39d5b..04897d5 100644 --- a/plug-ins/common/file-psp.c +++ b/plug-ins/common/file-psp.c @@ -1197,6 +1197,10 @@ read_channel_data (FILE *f, } else fread (buf, runcount, 1, f); + + /* prevent buffer overflow for bogus data */ + runcount = MIN (runcount, endq - q); + if (bytespp == 1) { memmove (q, buf, runcount); -- cgit v0.8.3.1 ++++++ gimp-CVE-2011-2896.patch ++++++
From 0eae221c7c6eb84591d718587a17ea90c8852d5b Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Thu, 04 Aug 2011 10:47:44 +0000 Subject: file-gif-load: ensure return value of LZWReadByte() is <= 255
(cherry picked from commit b1a3de761362db982c0ddfaff60ab4a3c4267f32) --- diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c index 9a0720b..a4d98fc 100644 --- a/plug-ins/common/file-gif-load.c +++ b/plug-ins/common/file-gif-load.c @@ -743,11 +743,11 @@ LZWReadByte (FILE *fd, } while (firstcode == clear_code); - return firstcode; + return firstcode & 255; } if (sp > stack) - return *--sp; + return (*--sp) & 255; while ((code = GetCode (fd, code_size, FALSE)) >= 0) { @@ -770,7 +770,7 @@ LZWReadByte (FILE *fd, sp = stack; firstcode = oldcode = GetCode (fd, code_size, FALSE); - return firstcode; + return firstcode & 255; } else if (code == end_code) { @@ -826,10 +826,10 @@ LZWReadByte (FILE *fd, oldcode = incode; if (sp > stack) - return *--sp; + return (*--sp) & 255; } - return code; + return code & 255; } static gint32 -- cgit v0.9.0.2
From 62718f821b7c79a6860b8b25f0a21a91daa6e22d Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Thu, 04 Aug 2011 10:51:42 +0000 Subject: file-gif-load: fix heap corruption and buffer overflow (CVE-2011-2896)
(cherry picked from commit 376ad788c1a1c31d40f18494889c383f6909ebfc) --- diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c index a4d98fc..8460ec0 100644 --- a/plug-ins/common/file-gif-load.c +++ b/plug-ins/common/file-gif-load.c @@ -697,7 +697,8 @@ LZWReadByte (FILE *fd, static gint firstcode, oldcode; static gint clear_code, end_code; static gint table[2][(1 << MAX_LZW_BITS)]; - static gint stack[(1 << (MAX_LZW_BITS)) * 2], *sp; +#define STACK_SIZE ((1 << (MAX_LZW_BITS)) * 2) + static gint stack[STACK_SIZE], *sp; gint i; if (just_reset_LZW) @@ -772,7 +773,7 @@ LZWReadByte (FILE *fd, return firstcode & 255; } - else if (code == end_code) + else if (code == end_code || code > max_code) { gint count; guchar buf[260]; @@ -791,13 +792,14 @@ LZWReadByte (FILE *fd, incode = code; - if (code >= max_code) + if (code == max_code) { - *sp++ = firstcode; + if (sp < &(stack[STACK_SIZE])) + *sp++ = firstcode; code = oldcode; } - while (code >= clear_code) + while (code >= clear_code && sp < &(stack[STACK_SIZE])) { *sp++ = table[1][code]; if (code == table[0][code]) @@ -808,7 +810,8 @@ LZWReadByte (FILE *fd, code = table[0][code]; } - *sp++ = firstcode = table[1][code]; + if (sp < &(stack[STACK_SIZE])) + *sp++ = firstcode = table[1][code]; if ((code = max_code) < (1 << MAX_LZW_BITS)) { -- cgit v0.9.0.2 ++++++ gimp-fix-linking.patch ++++++
From 582cb0f14eb9f145bd2a2f5c9fda12309ae0229f Mon Sep 17 00:00:00 2001 From: Manish Singh <yosh@gimp.org> Date: Sun, 24 May 2009 17:42:39 +0000 Subject: Explicitly specify library dependencies at link time, so we can use gold.
--- (limited to 'libgimpthumb/Makefile.am') diff --git a/libgimpthumb/Makefile.am b/libgimpthumb/Makefile.am index a78a83a..98acd24 100644 --- a/libgimpthumb/Makefile.am +++ b/libgimpthumb/Makefile.am @@ -86,7 +86,10 @@ noinst_PROGRAMS = gimp-thumbnail-list gimp_thumbnail_list_SOURCES = gimp-thumbnail-list.c -gimp_thumbnail_list_LDADD = libgimpthumb-$(GIMP_API_VERSION).la +gimp_thumbnail_list_LDADD = \ + libgimpthumb-$(GIMP_API_VERSION).la \ + $(GDK_PIXBUF_LIBS) \ + $(GLIB_LIBS) install-data-local: install-ms-lib install-libtool-import-lib -- cgit v0.9.0.2 Index: gimp-2.6.11/plug-ins/script-fu/Makefile.am =================================================================== --- gimp-2.6.11.orig/plug-ins/script-fu/Makefile.am +++ gimp-2.6.11/plug-ins/script-fu/Makefile.am @@ -8,7 +8,7 @@ libgimpbase = $(top_builddir)/libgimpbas libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la -libtinyscheme=tinyscheme/libtinyscheme.a +libtinyscheme=tinyscheme/libtinyscheme.a -lm libftx=ftx/libftx.a if OS_WIN32 ++++++ gimp-poppler-0.18.patch ++++++
From 69f69eed816b89be9a01a48a1f0643d1fd496118 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Fri, 6 May 2011 11:58:44 +0200 Subject: [PATCH] patch: poppler-0.17
Squashed commit of the following: commit 529d940222dfc352d41fbf72de29134421aa4002 Author: Nils Philippsen <nils@redhat.com> Date: Fri May 6 11:50:30 2011 +0200 use code based on pixbufs instead of cairo surfaces this is done to avoid adding to libgimp, thanks to Mukund Sivaraman for hints how to do this commit f8671d8767d4cdab830dc06310e96c63a88ec0fd Author: Mukund Sivaraman <muks@banu.com> Date: Thu Apr 21 13:57:13 2011 +0530 file-pdf-load: Update attribution, removing bogus copyright (cherry picked from commit e999122e0b20b6ccd6bde3ce039bb64068fc0019) commit 89a78f2590d298dac2f42e6d9a3016fc5d672c70 Author: Nils Philippsen <nils@redhat.com> Date: Thu Apr 21 13:52:18 2011 +0200 file-pdf-load: Use better API + cleanups * fixes issues with poppler 0.17 completely * uses new libgimp API to pass surfaces instead of pixbufs * uses GTK+ 3 API to convert surfaces to pixbufs where available (backported from commit 7bdadd80ba479d6ff904e276d805e16f6b940ee2) commit 4e92302c4a14a961f112587a0ad86696c88da2f8 Author: Nils Philippsen <nils@redhat.com> Date: Thu Apr 21 13:38:08 2011 +0200 file-pdf-load: Don't use deprecated API (bug #646947) (cherry picked from commit 9b3e1c91fd2eac69da6947ec9c7fbf10096ba237) Conflicts: plug-ins/common/file-pdf.c --- plug-ins/common/file-pdf.c | 323 ++++++++++++++++++++++++++++++++++++++------ 1 files changed, 283 insertions(+), 40 deletions(-) diff --git a/plug-ins/common/file-pdf.c b/plug-ins/common/file-pdf.c index a43b459..43c2b7d 100644 --- a/plug-ins/common/file-pdf.c +++ b/plug-ins/common/file-pdf.c @@ -4,6 +4,9 @@ * * Copyright (C) 2005 Nathan Summers * + * Some code in render_page_to_surface() borrowed from + * poppler.git/glib/poppler-page.cc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -80,16 +83,20 @@ static gboolean load_dialog (PopplerDocument *doc, static PopplerDocument * open_document (const gchar *filename, GError **error); -static GdkPixbuf * get_thumbnail (PopplerDocument *doc, +static cairo_surface_t * get_thumb_surface (PopplerDocument *doc, + gint page, + gint preferred_size); + +static GdkPixbuf * get_thumb_pixbuf (PopplerDocument *doc, gint page, gint preferred_size); static gint32 layer_from_pixbuf (gint32 image, - const gchar *layer_name, - gint position, - GdkPixbuf *buf, - gdouble progress_start, - gdouble progress_scale); + const gchar *layer_name, + gint position, + GdkPixbuf *pixbuf, + gdouble progress_start, + gdouble progress_scale); /** ** the following was formerly part of @@ -433,11 +440,12 @@ run (const gchar *name, } else { - gdouble width = 0; - gdouble height = 0; - gdouble scale; - gint32 image = -1; - GdkPixbuf *pixbuf = NULL; + gdouble width = 0; + gdouble height = 0; + gdouble scale; + gint32 image = -1; + gint num_pages = 0; + GdkPixbuf *pixbuf = NULL; /* Possibly retrieve last settings */ gimp_get_data (LOAD_PROC, &loadvals); @@ -455,7 +463,10 @@ run (const gchar *name, g_object_unref (page); } - pixbuf = get_thumbnail (doc, 0, param[1].data.d_int32); + num_pages = poppler_document_get_n_pages (doc); + + pixbuf = get_thumb_pixbuf (doc, 0, param[1].data.d_int32); + g_object_unref (doc); } @@ -548,6 +559,187 @@ open_document (const gchar *filename, return doc; } +/* FIXME: Remove this someday when we depend fully on GTK+ >= 3 */ + +#if (!GTK_CHECK_VERSION (3, 0, 0)) + +static cairo_format_t +gdk_cairo_format_for_content (cairo_content_t content) +{ + switch (content) + { + case CAIRO_CONTENT_COLOR: + return CAIRO_FORMAT_RGB24; + case CAIRO_CONTENT_ALPHA: + return CAIRO_FORMAT_A8; + case CAIRO_CONTENT_COLOR_ALPHA: + default: + return CAIRO_FORMAT_ARGB32; + } +} + +static cairo_surface_t * +gdk_cairo_surface_coerce_to_image (cairo_surface_t *surface, + cairo_content_t content, + int src_x, + int src_y, + int width, + int height) +{ + cairo_surface_t *copy; + cairo_t *cr; + + copy = cairo_image_surface_create (gdk_cairo_format_for_content (content), + width, + height); + + cr = cairo_create (copy); + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + cairo_set_source_surface (cr, surface, -src_x, -src_y); + cairo_paint (cr); + cairo_destroy (cr); + + return copy; +} + +static void +convert_alpha (guchar *dest_data, + int dest_stride, + guchar *src_data, + int src_stride, + int src_x, + int src_y, + int width, + int height) +{ + int x, y; + + src_data += src_stride * src_y + src_x * 4; + + for (y = 0; y < height; y++) { + guint32 *src = (guint32 *) src_data; + + for (x = 0; x < width; x++) { + guint alpha = src[x] >> 24; + + if (alpha == 0) + { + dest_data[x * 4 + 0] = 0; + dest_data[x * 4 + 1] = 0; + dest_data[x * 4 + 2] = 0; + } + else + { + dest_data[x * 4 + 0] = (((src[x] & 0xff0000) >> 16) * 255 + alpha / 2) / alpha; + dest_data[x * 4 + 1] = (((src[x] & 0x00ff00) >> 8) * 255 + alpha / 2) / alpha; + dest_data[x * 4 + 2] = (((src[x] & 0x0000ff) >> 0) * 255 + alpha / 2) / alpha; + } + dest_data[x * 4 + 3] = alpha; + } + + src_data += src_stride; + dest_data += dest_stride; + } +} + +static void +convert_no_alpha (guchar *dest_data, + int dest_stride, + guchar *src_data, + int src_stride, + int src_x, + int src_y, + int width, + int height) +{ + int x, y; + + src_data += src_stride * src_y + src_x * 4; + + for (y = 0; y < height; y++) { + guint32 *src = (guint32 *) src_data; + + for (x = 0; x < width; x++) { + dest_data[x * 3 + 0] = src[x] >> 16; + dest_data[x * 3 + 1] = src[x] >> 8; + dest_data[x * 3 + 2] = src[x]; + } + + src_data += src_stride; + dest_data += dest_stride; + } +} + +/** + * gdk_pixbuf_get_from_surface: + * @surface: surface to copy from + * @src_x: Source X coordinate within @surface + * @src_y: Source Y coordinate within @surface + * @width: Width in pixels of region to get + * @height: Height in pixels of region to get + * + * Transfers image data from a #cairo_surface_t and converts it to an RGB(A) + * representation inside a #GdkPixbuf. This allows you to efficiently read + * individual pixels from cairo surfaces. For #GdkWindows, use + * gdk_pixbuf_get_from_window() instead. + * + * This function will create an RGB pixbuf with 8 bits per channel. + * The pixbuf will contain an alpha channel if the @surface contains one. + * + * Return value: (transfer full): A newly-created pixbuf with a reference + * count of 1, or %NULL on error + */ +static GdkPixbuf * +gdk_pixbuf_get_from_surface (cairo_surface_t *surface, + gint src_x, + gint src_y, + gint width, + gint height) +{ + cairo_content_t content; + GdkPixbuf *dest; + + /* General sanity checks */ + g_return_val_if_fail (surface != NULL, NULL); + g_return_val_if_fail (width > 0 && height > 0, NULL); + + content = cairo_surface_get_content (surface) | CAIRO_CONTENT_COLOR; + dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, + !!(content & CAIRO_CONTENT_ALPHA), + 8, + width, height); + + surface = gdk_cairo_surface_coerce_to_image (surface, content, + src_x, src_y, + width, height); + cairo_surface_flush (surface); + if (cairo_surface_status (surface) || dest == NULL) + { + cairo_surface_destroy (surface); + return NULL; + } + + if (gdk_pixbuf_get_has_alpha (dest)) + convert_alpha (gdk_pixbuf_get_pixels (dest), + gdk_pixbuf_get_rowstride (dest), + cairo_image_surface_get_data (surface), + cairo_image_surface_get_stride (surface), + 0, 0, + width, height); + else + convert_no_alpha (gdk_pixbuf_get_pixels (dest), + gdk_pixbuf_get_rowstride (dest), + cairo_image_surface_get_data (surface), + cairo_image_surface_get_stride (surface), + 0, 0, + width, height); + + cairo_surface_destroy (surface); + return dest; +} + +#endif + static gint32 layer_from_pixbuf (gint32 image, const gchar *layer_name, @@ -566,6 +758,54 @@ layer_from_pixbuf (gint32 image, return layer; } +static cairo_surface_t * +render_page_to_surface (PopplerPage *page, + int width, + int height, + double scale) +{ + cairo_surface_t *surface; + cairo_t *cr; + + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); + cr = cairo_create (surface); + + cairo_save (cr); + cairo_translate (cr, 0.0, 0.0); + + if (scale != 1.0) + cairo_scale (cr, scale, scale); + + poppler_page_render (page, cr); + cairo_restore (cr); + + cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); + cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); + cairo_paint (cr); + + cairo_destroy (cr); + + return surface; +} + +static GdkPixbuf * +render_page_to_pixbuf (PopplerPage *page, + int width, + int height, + double scale) +{ + GdkPixbuf *pixbuf; + cairo_surface_t *surface; + + surface = render_page_to_surface (page, width, height, scale); + pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, + cairo_image_surface_get_width (surface), + cairo_image_surface_get_height (surface)); + cairo_surface_destroy (surface); + + return pixbuf; +} + static gint32 load_image (PopplerDocument *doc, const gchar *filename, @@ -597,7 +837,7 @@ load_image (PopplerDocument *doc, gdouble page_width; gdouble page_height; - GdkPixbuf *buf; + GdkPixbuf *pixbuf; gint width; gint height; @@ -627,15 +867,13 @@ load_image (PopplerDocument *doc, gimp_image_set_resolution (image_ID, resolution, resolution); } - buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height); - - poppler_page_render_to_pixbuf (page, 0, 0, width, height, scale, 0, buf); + pixbuf = render_page_to_pixbuf (page, width, height, scale); - layer_from_pixbuf (image_ID, page_label, i, buf, + layer_from_pixbuf (image_ID, page_label, i, pixbuf, doc_progress, 1.0 / pages->n_pages); g_free (page_label); - g_object_unref (buf); + g_object_unref(pixbuf); doc_progress = (double) (i + 1) / pages->n_pages; gimp_progress_update (doc_progress); @@ -676,30 +914,22 @@ load_image (PopplerDocument *doc, return image_ID; } -static GdkPixbuf * -get_thumbnail (PopplerDocument *doc, - gint page_num, - gint preferred_size) +static cairo_surface_t * +get_thumb_surface (PopplerDocument *doc, + gint page_num, + gint preferred_size) { PopplerPage *page; - GdkPixbuf *pixbuf; + cairo_surface_t *surface; page = poppler_document_get_page (doc, page_num); if (! page) return NULL; - /* XXX: Remove conditional when we depend on poppler 0.8.0, but also - * add configure check to make sure POPPLER_WITH_GDK is enabled! - */ -#ifdef POPPLER_WITH_GDK - pixbuf = poppler_page_get_thumbnail_pixbuf (page); -#else - pixbuf = poppler_page_get_thumbnail (page); -#endif - + surface = poppler_page_get_thumbnail (page); - if (! pixbuf) + if (! surface) { gdouble width; gdouble height; @@ -712,15 +942,28 @@ get_thumbnail (PopplerDocument *doc, width *= scale; height *= scale; - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, - width, height); - - poppler_page_render_to_pixbuf (page, - 0, 0, width, height, scale, 0, pixbuf); + surface = render_page_to_surface (page, width, height, scale); } g_object_unref (page); + return surface; +} + +static GdkPixbuf * +get_thumb_pixbuf (PopplerDocument *doc, + gint page_num, + gint preferred_size) +{ + cairo_surface_t *surface; + GdkPixbuf *pixbuf; + + surface = get_thumb_surface (doc, page_num, preferred_size); + pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, + cairo_image_surface_get_width (surface), + cairo_image_surface_get_height (surface)); + cairo_surface_destroy (surface); + return pixbuf; } @@ -769,8 +1012,8 @@ thumbnail_thread (gpointer data) idle_data->page_no = i; /* FIXME get preferred size from somewhere? */ - idle_data->pixbuf = get_thumbnail (thread_data->document, i, - THUMBNAIL_SIZE); + idle_data->pixbuf = get_thumb_pixbuf (thread_data->document, i, + THUMBNAIL_SIZE); g_idle_add (idle_set_thumbnail, idle_data); -- 1.7.5 ++++++ gimp-pyslice-cellspacing-fix.patch ++++++
From 16d77f975b2c398a515f91e34ef868dc3bb49228 Mon Sep 17 00:00:00 2001 From: Nils Philippsen <nils@redhat.com> Date: Wed, 02 Feb 2011 16:11:28 +0000 Subject: Bug 641259 - [abrt] gimp-2:2.6.11-1.fc14: py-slice.py:172:slice:TypeError: integer argument expected, got float
py-slice: cast cellspacing to int in pyslice() to avoid tracebacks (cherry picked from commit 0af966b63fcc55b36380d6538dfb30000f71fef9) --- diff --git a/plug-ins/pygimp/plug-ins/py-slice.py b/plug-ins/pygimp/plug-ins/py-slice.py index 40743f3..ac35f23 100755 --- a/plug-ins/pygimp/plug-ins/py-slice.py +++ b/plug-ins/pygimp/plug-ins/py-slice.py @@ -36,6 +36,9 @@ gettext.install("gimp20-python", gimp.locale_directory, unicode=True) def pyslice(image, drawable, save_path, html_filename, image_basename, image_extension, separate, image_path, cellspacing, animate, skip_caps): + + cellspacing = int (cellspacing) + if animate: count = 0 drw = [] -- cgit v0.9.0.2 ++++++ macros.gimp ++++++ # # Interface versions exposed by GIMP: # %gimp_api_version @GIMP_APIVER@ %gimp_abi_version @GIMP_ABIVER@++++++ openSUSE.gpl ++++++ GIMP Palette Name: openSUSE Columns: 7 # 252 177 28 Orange Light 255 255 102 Butter Light 145 208 7 Lemon Light 212 196 255 Plum Light 80 128 255 Sky Light 186 189 182 Dust Light 255 77 77 Blood Light 227 83 2 Orange 178 178 71 Butter 33 120 8 Lemon 77 68 102 Plum 0 0 116 Sky 46 52 54 Dust 140 0 0 Blood 115 186 37 SUSE Green -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de