[Image-SIG] Image.resize problem

Steve Holden steve at holdenweb.com
Sun Sep 11 06:28:18 CEST 2005


David Dahl wrote:
> For some reason Image.resize will not work for me. Here is my method:
> 
> import Image
> 
> def resize_image(self,infile,outfile):
>          im = Image.open(infile)
>          size = 800, 600
>          im.resize(size)
>          im.save(outfile,'JPEG' )
> 
> 
> The files is written, but it is the same size as the original file.  
> The thumbnail function works fine, maybe that is all I need? What is  
> the real difference between resize() and thumbnail()?
> 
The problem is occurring because im.resize() isn't an in-place update: 
it returns a new image!

Try

         im = im.resize(size)

and see if that improves things.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/


More information about the Image-SIG mailing list