WebP support

Michael Droettboom <mdroe@...86...> writes:

Benjamin Root<ben.root@...1304...> writes:

And yet, we still allow for saving to jpegs.
     

Wow, I didn't know. Last time I tried that I got a traceback, and
assumed that it was not supported exactly because jpeg is a nonsensical
format for most graphs.

I just tried again, and got "TypeError: 'int' object is unsubscriptable"
from PIL/JpegImagePlugin.pyc in _save(im, fp, filename). I suppose this
doesn't get much testing.
   

Aside from the question of whether we "should" support JPEGs, etc., that
code path should work (and in fact it does on my machine). What version
of PIL do you have installed, and can you provide the full traceback
here?

It seems that I have an egg install of version 1.1.6., and here's a
traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jks/Hacking/mpl/git/lib/matplotlib/pyplot.py", line 363, in savefig
    return fig.savefig(*args, **kwargs)
  File "/Users/jks/Hacking/mpl/git/lib/matplotlib/figure.py", line 1160, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/Users/jks/Hacking/mpl/git/lib/matplotlib/backend_bases.py", line 1961, in print_figure
    **kwargs)
  File "/Users/jks/Hacking/mpl/git/lib/matplotlib/backend_bases.py", line 1787, in print_jpg
    return image.save(filename_or_obj, **kwargs)
  File "/Library/Python/2.6/site-packages/PIL/Image.py", line 1405, in save
    save_handler(self, fp, filename)
  File "/Library/Python/2.6/site-packages/PIL/JpegImagePlugin.py", line 406, in _save
    dpi[0], dpi[1]
TypeError: 'int' object is unsubscriptable

It looks like something is now passing a dpi keyword argument to
print_jpg, but something inside PIL is expecting its value to be a
sequence. I'll commit a fix.

···

On 10/02/2010 01:39 PM, Jouni K. Sepp�nen wrote:

--
Jouni K. Sepp�nen
http://www.iki.fi/jks