<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>181318</bug_id>
          
          <creation_ts>2007-06-08 15:43 0000</creation_ts>
          <short_desc>libpng-1.2.18 nongray pixel error in links -g</short_desc>
          <delta_ts>2007-07-14 17:21:52 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>daviebdawg@gmail.com</reporter>
          <assigned_to>vanquirius@gentoo.org</assigned_to>
          <cc>base-system@gentoo.org</cc>
    
    <cc>gentoo@infinityends.com</cc>
    
    <cc>stw@gmx.de</cc>

      

      
          <long_desc isprivate="0">
            <who>daviebdawg@gmail.com</who>
            <bug_when>2007-06-08 15:43:56 0000</bug_when>
            <thetext>I recently upgraded libpng from 1.2.16 to 1.2.18. Now when I use the web browser links-2.1_pre26 in graphical mode (under X), it reports this error and closes as soon as certain pages load:
 Error when loading compiled-in font: png_do_rgb_to_gray found nongray pixel
 libpng error: png_do_rgb_to_gray found nongray pixel
 Aborted
As far as I can tell, this happens on pages with images. I get the problem on google.com but not www.dattalo.com, which is text-only.

I remerged links, but that didn&apos;t fix it. As soon as I downgraded to libpng-1.2.16 again, the problem disappeared.

Reproducible: Always

Steps to Reproduce:
1. links -g google.com
Actual Results:  
links window opens while page loads, then disappears before page displays. The error message above is left on terminal window.

Expected Results:  
loaded the web page, stayed open

Portage 2.1.2.7 (default-linux/x86/2006.1/desktop, gcc-4.1.2, glibc-2.5-r3, 2.6.18-gentoo-r6 i686)
=================================================================
System uname: 2.6.18-gentoo-r6 i686 Celeron (Mendocino)
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 07 Jun 2007 17:59:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5-r3, 2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r7
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=i686 -O2&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/share/X11/xkb&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo&quot;
CXXFLAGS=&quot;-march=i686 -O2&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;ccache distcc distlocks metadata-transfer sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo&quot;
LINGUAS=&quot;en&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;X alsa bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt dbus dri dvd dvdr emboss encode fam fortran gdbm gif gpm gstreamer gtk hal iconv isdnlog jpeg ldap libg++ mad midi mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre perl png ppds pppd python quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts unicode win32codecs x86 xml xorg xv zlib&quot; ALSA_CARDS=&quot;emu10k1&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;en&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;mach64 vesa vga&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stw@gmx.de</who>
            <bug_when>2007-07-05 08:12:59 0000</bug_when>
            <thetext>The bug is reproducable. A quick workaround is to downgrade to libpng 1.2.16. A solution is to upgrade to libpng &gt;=1.2.19beta19  More info:  Links uses png images for the fonts. It converts them to grayscale using libpng&apos;s png_do_rgb_to_gray functionality. This can return a warning or an error, if the programmer wants it to. This is set by a function png_set_rgb_to_gray_fixed(png, error_action, r, g) where error_action=1 indicates to ignore all nongray pixels.  In libpng 1.2.17beta2 they changed the evaluation of this error_action, causing it to always give an error, which causes links to abort, if it tries to display a character that was not encoded in a grayscale png-file. E.g. &amp; #9660 ; is used on Google. Took me some time to find that out.  The good news: This bug in libpng has already been found and removed in version 1.2.19beta19 [June 28, 2007]. We should mark everything in between to be buggy. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-07-09 23:36:26 0000</bug_when>
            <thetext>post the diff and i&apos;ll add it to 1.2.18-r1</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stw@gmx.de</who>
            <bug_when>2007-07-10 06:58:38 0000</bug_when>
            <thetext>Created an attachment (id=124398)
Patch fixing the GRAY_WARN handler

Made from the diffs between libpng-1.2.18 and libpng-1.2.19beta19, but stripped to contain only the error handler for the GRAY_WARN and GRAY_ERR flags.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stw@gmx.de</who>
            <bug_when>2007-07-10 07:01:13 0000</bug_when>
            <thetext>Alright, that&apos;s the patch. Worked fine for me here.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@infinityends.com</who>
            <bug_when>2007-07-14 14:41:40 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; Alright, that&apos;s the patch. Worked fine for me here.
&gt; 

I tested this patch, works fine.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-07-14 17:21:52 0000</bug_when>
            <thetext>thanks Steffen, 1.2.18-r1 now in the tree with that patch</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>124398</attachid>
            <date>2007-07-10 06:58 0000</date>
            <desc>Patch fixing the GRAY_WARN handler</desc>
            <filename>graywarning-1.2.18.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHBuZ3J0cmFuLmMub3JpCTIwMDctMDUtMTYgMDE6NTI6MjQuMDAwMDAwMDAwICswMjAwCisr
KyBwbmdydHJhbi5jCTIwMDctMDYtMjggMjM6MDQ6MDYuMDAwMDAwMDAwICswMjAwCkBAIC0xMjkz
LDkgKzEyOTMsMTEgQEAKICAgICAgIGlmKHJnYl9lcnJvcikKICAgICAgIHsKICAgICAgICAgIHBu
Z19wdHItPnJnYl90b19ncmF5X3N0YXR1cz0xOwotICAgICAgICAgaWYocG5nX3B0ci0+dHJhbnNm
b3JtYXRpb25zICYgUE5HX1JHQl9UT19HUkFZX1dBUk4pCisgICAgICAgICBpZigocG5nX3B0ci0+
dHJhbnNmb3JtYXRpb25zICYgUE5HX1JHQl9UT19HUkFZKSA9PQorICAgICAgICAgICAgIFBOR19S
R0JfVE9fR1JBWV9XQVJOKQogICAgICAgICAgICAgcG5nX3dhcm5pbmcocG5nX3B0ciwgInBuZ19k
b19yZ2JfdG9fZ3JheSBmb3VuZCBub25ncmF5IHBpeGVsIik7Ci0gICAgICAgICBpZihwbmdfcHRy
LT50cmFuc2Zvcm1hdGlvbnMgJiBQTkdfUkdCX1RPX0dSQVlfRVJSKQorICAgICAgICAgaWYoKHBu
Z19wdHItPnRyYW5zZm9ybWF0aW9ucyAmIFBOR19SR0JfVE9fR1JBWSkgPT0KKyAgICAgICAgICAg
ICBQTkdfUkdCX1RPX0dSQVlfRVJSKQogICAgICAgICAgICAgcG5nX2Vycm9yKHBuZ19wdHIsICJw
bmdfZG9fcmdiX3RvX2dyYXkgZm91bmQgbm9uZ3JheSBwaXhlbCIpOwogICAgICAgfQogICAgfQo=
</data>        

          </attachment>
    </bug>

</bugzilla>