Re: [Rest2web-develop] Gallery Test chokes on animated jpg
Brought to you by:
mjfoord
From: Michael F. <fuz...@vo...> - 2006-03-22 19:35:17
|
Marc wrote: > Hi Fuzzyman, > > This is just FYI. Enclosed is a sample jpg that causes this error. I understand why it's not supported, just thought you might want to skip these. > > Just FYI, > Marc > > > Ok. It's a limitation in the Python Imaging Library which I use to handle the images (although I can understand why it struggles to create a thumbnail of an animated jpg.) The only way to avoid this (as far as I can tell) is to trap the error and skip the file - probably with a warning. Until I implement a reduced verbosity mode - the warning might be difficult to spot though. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Animals\../../sites/marcs1stsite/Personal/Galleries/Animals/Cats\CatsAndDoves.jpg > [err] Traceback (most recent call last): > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web.py", line 168, in ? > [err] count = main(config) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web.py", line 104, in main > [err] return processor.walk() > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web\restprocessor.py", line 187, in walk > [err] self.setdefaults(dir_list) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web\restprocessor.py", line 459, in setdefaults > [err] restindex, uservalues)) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web\restprocessor.py", line 1312, in do_plugin > [err] return self.plugins[plugin].page(filename, target, restindex, uservalues) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web\plugins\gallery.py", line 76, in page > [err] data = get_info(params) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\rest2web-0.4.0alpha\rest2web\plugins\gallery.py", line 143, in get_info > [err] im.save(thumb_name) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\Lib\site-packages\PIL\Image.py", line 1305, in save > [err] save_handler(self, fp, filename) > [err] File "C:\Documents and Settings\All Users\Documents\Python242\Lib\site-packages\PIL\JpegImagePlugin.py", line 390, in _save > [err] raise IOError("cannot write mode %s as JPEG" % im.mode) > [err] IOError: cannot write mode P as JPEG > [err] > > ------------------------------------------------------------------------ > > |