Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109783 - pngtopnm does not create PBM on bw source, and does not create PGM on gray source as said in the manual
Summary: pngtopnm does not create PBM on bw source, and does not create PGM on gray so...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-19 02:50 UTC by Erik Thiele
Modified: 2005-10-29 18:58 UTC (History)
1 user (show)

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


Attachments
bw.png (bw.png,939 bytes, image/png)
2005-10-26 06:27 UTC, Erik Thiele
Details
gray.png (gray.png,3.03 KB, image/png)
2005-10-26 06:27 UTC, Erik Thiele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Thiele 2005-10-19 02:50:18 UTC
*  media-libs/netpbm
      Latest version available: 10.29
      Latest version installed: 10.29

start gimp. create picture. draw some lines in different shades of gray. convert
picture to grayscale colorspace, save it as "gray.png"

erik@goofy:~bugrep$ identify -verbose gray.png

gray.png PNG 420x300 420x300+0+0 PseudoClass 256c 3kb 
Image: gray.png
  Format: PNG (Portable Network Graphics)
  Geometry: 420x300
  Class: PseudoClass
  Type: Grayscale
  Endianess: Undefined
  Colorspace: Gray       <<<<<<<< SEE HERE
  Channel depth:
    Gray: 8-bits
  Channel statistics:
    Gray:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 0.259048 (0.00101587)
      Standard deviation: 6.63757 (0.0260297)
  Colors: 256
  Histogram:
       928: (  0,  0,  0)	black
        15: (  1,  1,  1)	#010101
**** snipped to make bugreport shorter
**** but all colors have equal R,G,B values -> all gray
        61: (252,252,252)	grey99
    122718: (255,255,255)	white
        99: (254,254,254)	#FEFEFE
  Rendering-intent: Undefined
  Resolution: 28.35x28.35
  Units: PixelsPerCentimeter
  Filesize: 3kb
  Interlace: None
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: grey74
  Page geometry: 420x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Comment: Created with The GIMP
  Signature: 69e3568437446a6c07bd1a0f70db955eb717e6f106f72cc0d612bd277bd809fa
  Tainted: False
  Version: ImageMagick 6.2.2 06/18/05 Q16 http://www.imagemagick.org

now using netpbm-10.29:
pngtopnm gray.png >gray_29
and using netpbm-10.28:
pngtopnm gray.png >gray_28

erik@goofy:~/bugrep$ file gray_*
gray_28: Netpbm PGM "rawbits" image data
gray_29: Netpbm PPM "rawbits" image data
erik@goofy:~/bugrep$ 

you see, once PPM, once PGM. manpage of pngtopnm implies that PGM should be
created. so the behaviour of netpbm-10.29 is wrong here.


******** NEXT PROBLEM

start gimp. create picture. draw some lines. convert picture to index
colorspace, 2 colors, black and white. save it as "bw.png"

erik@goofy:~/bugrep$ identify -verbose bw.png 
bw.png PNG 420x300 420x300+0+0 PseudoClass 2c 939 
Image: bw.png
  Format: PNG (Portable Network Graphics)
  Geometry: 420x300
  Class: PseudoClass
  Type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Channel depth:
    Gray: 1-bits
  Channel statistics:
    Gray:
      Min: 0 (0)
      Max: 1 (1)
      Mean: 7.93651e-06 (7.93651e-06)
      Standard deviation: 0.00281717 (0.00281717)
  Colors: 2
  Histogram:
      9689: (  0,  0,  0)       black <<< SEE HERE, FULL BLACK
    116311: (255,255,255)       white <<< SEE HERE, FULL WHITE
  Rendering-intent: Undefined
  Resolution: 28.35x28.35
  Units: PixelsPerCentimeter
  Filesize: 939
  Interlace: None
  Background Color: white
  Border Color: #DFDFDF
  Matte Color: grey74
  Page geometry: 420x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Comment: Created with The GIMP
  Signature: 8623b66fd24218b8e6162e504f6cef9d3f7bddb70f5761a5f7dd5f345fe83c77
  Tainted: False
  Version: ImageMagick 6.2.2 06/18/05 Q16 http://www.imagemagick.org
erik@goofy:~/bugrep$ 

here pngtopnm produces a PGM file in both netpbm 10.29 and 10.28. but the
manpage of pngtopnm implies that a PBM should be generated instead.


Reproducible: Always
Steps to Reproduce:




Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2,
2.6.12-gentoo-r10 i686)
=================================================================
System uname: 2.6.12-gentoo-r10 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks nostrip sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE"
LINGUAS="de"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups curl doc dvd eds
emboss encode esd fam flac font-server foomaticdb fortran gd gdbm gif gimpprint
gnome gphoto2 gpm gstreamer gtk gtk2 imagemagick imlib java jpeg kde ldap libg++
libwww mad mikmod motif mozilla mp3 mpeg ncurses nls ogg oggvorbis opengl oss
pam pdflib perl plotutils png postgres ppds python qt quicktime readline samba
scanner sdl slang spell ssl tcltk tcpd tetex tiff truetype truetype-fonts
type1-fonts usb vorbis xine xml2 xmms xv zlib linguas_de userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 1 SpanKY gentoo-dev 2005-10-20 11:31:08 UTC
try netpbm-10.30
Comment 2 SpanKY gentoo-dev 2005-10-25 20:46:43 UTC
get back to us please
Comment 3 Erik Thiele 2005-10-26 00:53:28 UTC
erik@goofy:~$ pngtopnm --version
pngtopnm: Using libnetpbm from Netpbm Version: Netpbm 10.30.0
pngtopnm: Compiled Mi Okt 26 09:48:41 CEST 2005 by user "root"
pngtopnm: BSD defined
pngtopnm: RGB_ENV='RGBDEF'
pngtopnm: RGBENV= 'RGBDEF' (env vbl is unset)
erik@goofy:~/bugrep$ pngtopnm gray.png  > gray_30
erik@goofy:~/bugrep$ file gray_*
gray_28: Netpbm PGM "rawbits" image data << right
gray_29: Netpbm PPM "rawbits" image data << wrong
gray_30: Netpbm PPM "rawbits" image data << wrong
erik@goofy:~/bugrep$ pngtopnm bw.png >bw_30
erik@goofy:~/bugrep$ file bw_*
bw_28: Netpbm PGM "rawbits" image data << wrong
bw_29: Netpbm PGM "rawbits" image data << wrong
bw_30: Netpbm PGM "rawbits" image data << wrong
erik@goofy:~/bugrep$ 
Comment 4 SpanKY gentoo-dev 2005-10-26 06:18:58 UTC
then post the actual images so we can try to reproduce
Comment 5 Erik Thiele 2005-10-26 06:27:26 UTC
Created attachment 71505 [details]
bw.png
Comment 6 Erik Thiele 2005-10-26 06:27:48 UTC
Created attachment 71506 [details]
gray.png
Comment 7 SpanKY gentoo-dev 2005-10-26 06:30:46 UTC
should re-open then
Comment 8 SpanKY gentoo-dev 2005-10-29 01:40:54 UTC
ok, i confirmed the behavior and e-mailed upstream about it
Comment 9 SpanKY gentoo-dev 2005-10-29 18:58:38 UTC
ok, upstream gave me a fix for the gray.png handling which ive added to 10.30-r1

upstream also pointed out that your bw.png is wrong ... it's an 8 bit grayscale
PNG that just happens to have only black pixels and white pixels in it