Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 363493 - media-gfx/gimp-2.6.11-r1 with libpng-1.4.5 breaks indexed png saving
Summary: media-gfx/gimp-2.6.11-r1 with libpng-1.4.5 breaks indexed png saving
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Hanno Böck
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-13 15:09 UTC by Michał Ziąbkowski
Modified: 2011-04-20 15:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
modified png chunk from upstream bug (gimp-libpng15.diff,17.47 KB, patch)
2011-04-18 22:56 UTC, Rafał Mużyło
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Ziąbkowski 2011-04-13 15:09:27 UTC
After upgrading gimp to 2.6.11-r1 I noticed I was unable to save indexed PNG images anymore. It is a major regression leading to data loss in some circumstances.

This issue seems to have been brought about by the libpng-1.5 compatibility patch added in -r1. Saving works as intended after commenting out said patch and rebuilding. 

Reproducible: Always

Steps to Reproduce:
1. emerge =gimp-2.6.11-r1
2. Create a blank image in gimp
3. Convert it to indexed mode
4. Try saving it as png
Actual Results:  
All attempts result in a similar message:
Saving '/tmp/test.png' failed:

Error while saving '/tmp/test.png'. Could not save image.

And here's the relevant excerpt from .xsession-errors:
libpng warning: Invalid palette length
libpng error: Valid palette required for paletted images



Expected Results:  
Indexed messages should be saved properly as png.

Relevant package versions:

gimp-2.6.11-r1 and libpng-1.4.5

emerge --info:

Portage 2.2.0_alpha29 (default/linux/x86/10.0/desktop/kde, gcc-4.5.2, glibc-2.11.3-r0, 2.6.38-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.38-gentoo-r1-i686-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-2.0.2
Timestamp of tree: Tue, 12 Apr 2011 16:45:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r2, 3.1.3-r1
dev-util/cmake:      2.8.4
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.0
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5, 4.5.2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
Repositories: gentoo lcd-filtering pcsx2 local-overlay roslin
Installed sets: @kadu-modular, @system
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/hddtemp"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
DISTDIR="/var/tmp/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages news noinfo parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mirror.pw.edu.pl/"
LANG="pl_PL.UTF-8"
LC_ALL="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl"                                                                                                                  
MAKEOPTS="-j2 -s"                                                                                                             
PKGDIR="/var/tmp/packages"                                                                                                    
PORTAGE_CONFIGROOT="/"                                                                                                        
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/banned_branches"                                                        
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"                                                              
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/lcd-filtering /var/lib/layman/pcsx2 /usr/local/portage /home/mziab/roslin"
SYNC="rsync://rsync1.pl.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa bash-completion berkdb branding bzip2 cairo cdr cli consolekit cracklib crypt cups curl custom-cflags custom-cxxflags cxx dbus dri dts dvd dvdr emboss encode exif faac faad fam ffmpeg firefox flac fortran ftp gdbm gdu gif gstreamer gtk iconv inotify ipv6 joystick jpeg kde kdehiddenvisibility lame lcdfilter lcms libnotify lzma mad mmx mmxext mng modules mp3 mp4 mpeg mudflap musepack ncurses nls nptl nptlonly ogg opengl openmp pam pango pch pcre pdf perl png policykit ppds pppd python qt3support qt4 readline sdl session smp sndfile spell sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd threads tiff timidity truetype udev unicode usb vdpau vorbis wavpack win32codecs x264 x86 xcb xcomposite xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="none nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Rafał Mużyło 2011-04-13 18:06:08 UTC
For the moment, just a guess, but IIUC, png_set_PLTE shouldn't be called before png_set_IHDR is called.
Given that in this case png_get_PLTE can't be called before png_set_PLTE, that will require far more code restructuring than the current patch does.
Comment 2 Rafał Mużyło 2011-04-18 22:56:25 UTC
Created attachment 270445 [details, diff]
modified png chunk from upstream bug

One of the people from upstream bug sent me an updated patch - for the moment, only png chunk, mng may come later.
Attached patch still has the old mng chunk, but png part is updated.

It seems to work fine in trivial cases.

Could the reporter test if it works for them ?
Comment 3 Michał Ziąbkowski 2011-04-19 00:20:23 UTC
Yes, the patch seems to work. Saved a few png images in indexed and rgb modes and I've yet to see any breakage. Thanks.
Comment 4 Rafał Mużyło 2011-04-19 13:51:08 UTC
Patch with updated mng chunk has just been posted in the upstream bug.
Comment 5 Hanno Böck gentoo-dev 2011-04-19 20:03:25 UTC
I've added a new gimp revision with the new patch from upstream's bugreport. Hope this fixes all issues, please test.
Comment 6 Michał Ziąbkowski 2011-04-20 15:42:47 UTC
It works. I think it's safe to say the issue is resolved. Thank you to all involved.