"cyberco" <[EMAIL PROTECTED]> wrote:

> Thanks,
> 
> I've tried the StringIO option as follows:
> 
> =================================
> img = Image.open('/some/path/img.jpg')
> img.thumbnail((640,480))
> file = StringIO, StringIO()

Is the above line exactly what you tried? If it is, the comma and 
space in the line are likely the problem. Try either:

from StringIO import StringIO 
file=StringIO()

or

import StringIO
file=StringIO.StringIO()

(using file as a variable name can cause issues if you later want 
access to the built in object 'file')

The following:

>>> import Image
>>> import StringIO
>>> im=Image.new('RGB', (100,100))
>>> fp=StringIO.StringIO()
>>> im.save(fp, 'jpeg')
>>> len(fp.getvalue())
823

Works for me on python 2.5 on windows.


max

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to