Fixed GIF handling with PIL

svn: r500
This commit is contained in:
Don Allingham 2001-10-20 04:02:01 +00:00
parent c5153af1c6
commit ec6a3e74ac

View File

@ -115,16 +115,16 @@ def mk_thumb(source,dest,size):
GnomeErrorDialog(_("Could not create %s") % dir)
return
print source[-3:]
if no_pil or source[-4:] == ".gif":
if no_pil:
cmd = "%s -geometry %dx%d '%s' '%s'" % (const.convert,size,size,source,dest)
print cmd
os.system(cmd)
else:
try:
im = PIL.Image.open(source)
im.convert("RGB")
im.thumbnail((size,size))
if im.mode != 'RGB':
im.draft('RGB',im.size)
im = im.convert("RGB")
im.save(dest,"JPEG")
except:
pass