[19948] in Athena Bugs

home help back first fref pref prev next nref lref last post

gs and imlib interact poorly on Linux 9.0

daemon@ATHENA.MIT.EDU (Derek Atkins)
Tue Oct 30 12:28:20 2001

To: bugs@MIT.EDU
From: Derek Atkins <warlord@MIT.EDU>
Date: 30 Oct 2001 12:28:18 -0500
Message-ID: <sjmg081rqa5.fsf@benjamin.ihtfp.org>

I'm trying to load an eps into an gdk_imlib image.  When gs converts
the file to an image, it outputs a file that looks like:

P5
# Image generated by Aladdin Ghostscript (device=pnmraw)

139 117
255
<data>

Looking at this with od:

0000000   P   5  \n   #       I   m   a   g   e       g   e   n   e   r
0000020   a   t   e   d       b   y       A   l   a   d   d   i   n    
0000040   G   h   o   s   t   s   c   r   i   p   t       (   d   e   v
0000060   i   c   e   =   p   n   m   r   a   w   )  \n  \n   1   3   9
0000100       1   1   7  \n   2   5   5  \n   ÿ   ÿ   w  \0  \0  \0  \0


Unfortunately, imlib barfs on the blank line after the comment (see
/mit/source/third/imlib/gdk_imlib/io-ppm.c around line 50).

It's unclear whether gs is creating a bogus p*m or whether imlib is
barfing on a valid p*m.  Most likely this is a problem with both
programs.  Consenus on zephyr appears to be that this is imlib's fault
and the p*m is valid, but this is still speculation.

A quick fix would be to change line 50 to read:

      if (s[0] != '#' && s[0] != '\n')

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available

home help back first fref pref prev next nref lref last post