[IMAGE-SIG] PIL 0.2b4 & XBM files

Dan Fandrich DanF@xinex.com
Mon, 29 Sep 1997 16:41:00 -0700

I just installed the Python Imaging Library, rev. 0.2b4, and I soon
discovered two problems with XBM files. The first has to do with file
names with embedded underscore characters--these are not identified as
XBM files. The second has to do with end of line conventions. When
editing XBM files under DOS, they have CR as well as NL, which, again,
causes them to be not identified as XBM files. I patched
XbmImagePlugin.py by replacing the regular expression with the

# XBM header
xbm_head = regex.compile("^#define .*_width \([0-9]*\)\r*\n"
                         "#define .*_height \([0-9]*\)\r*\n"
                         ".*char .*_bits\[\]")

>>> Dan

IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org