[Image-SIG] Converting images to palette mode
charlie at begeistert.org
Wed Jan 28 10:10:22 CET 2009
Am 28.01.2009 um 00:29 schrieb Gregor Kopka:
> also while looking at it i'm not that sure why you don't check the
> extension by checking against a[-4:] == ".png" which i feel like a
> bit more readable compared to your if condition.
> Do you want to stop your code from processing files with a "." in
> the name (like 'mypic 02.05.2007.png') ?
Actually why not rely on os.path to identify things correctly in the
Which book still recommends code like this?
if string.find(a,'.') > 0 and string.split(a,'.')=='png' and
Strings have had methods since Python 1.6!
But os.path.splitext() is probably all you need. Sorry that this won't
help you find the cause of the crash.
More information about the Image-SIG