[IMAGE-SIG] problem reading .xbm files in PIL 0.3a1
Piers Lauder
piers@cs.su.oz.au
Mon, 07 Jul 1997 14:43:18 +1000
I have 2 .xbm format files:
: s facemail ; ls -l *face.xbm
-rw-rw---- 1 piers piers 1529 Jul 3 15:50 newface.xbm
-rw-rw---- 1 piers piers 1850 Jul 7 14:32 oldface.xbm
I can read one with PIL, but not the other. Both display fine with xv.
>>> import Image
>>> im=Image.open('newface.xbm')
>>> im=Image.open('oldface.xbm')
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python1.4/local/Image.py", line 713, in open
raise IOError, "cannot identify image file"
IOError: cannot identify image file
>>>
'newface' was created with PIL and looks like:
: s facemail ; sed 10q newface.xbm
#define im_width 48
#define im_height 48
static char im_bits[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x00,0x00,0x00,0x00,0x00,0x26,
0x06,0x00,0x00,0x00,0x80,0x09,0x11,0x00,0x00,0x00,0x40,0x04,0x40,0x00,0x00,
0x00,0xa0,0x02,0xa0,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x58,0x01,
'oldface' was created with xv, and looks like:
: s facemail ; sed 10q oldface.xbm
#define face_width 48
#define face_height 48
static char face_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xa0, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x78, 0xc0, 0x00, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x80, 0xbe, 0xfe, 0x02, 0x00,
Will the next release be able to read the 'xv' format?
(Or should I start writing a conversion routine :-)
________________________________________________________________________________
Computer Science, Sydney University, Madsen Bldg F09, Sydney NSW 2006, Australia
Phone: +61 2 9351 2824 Fax: +61 2 9351 3838 http://www.cs.su.oz.au/~piers
_______________
IMAGE-SIG - SIG on Image Processing with Python
send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________