tags:

views:

176

answers:

1

Hello, I have been using pil for the first time today. And I wanted to resize an image assuming it was larger than 800x600 and also create a thumbnail. I could do either of these tasks separately but not together in one method (I am doing a custom save method in django admin). This returns a "cannot identify image file" error message.

The error is on the line "image = Image.open(self.photo)" after "#if image is size is greatet than 800 x 600 then resize image."

I thought this may be because the image is already open, but if i remove the line I still get issues. So I thought I could try closing after creating a thumbnail and then reopening.

But I couldn't find a close method....

A: 

Ah, if i only open the orginal image once and create the thumbnail after resizing then the problem is solved

DNN