hi all: I was trying to rewrite the clean_XX() method like this:
1 def clean_media(self): 2 3 # save from a upload file 4 data = self.cleaned_data['media'] 5 tmp = open('img.jpg','wr') 6 tmp.write(data.read()) 7 tmp.close() 8 9 # open it 10 a = img.open('img.jpg','r') 11 if max(a.size[0], a.size[1]) > 78: 12 raise forms.ValidationError("pic too big....") this line: a = img.open('img.jpg','r') throw a error " Caught an exception while rendering: cannot identify image file " but I try it again with save or open alone( delete line 4-7 or delete line 10-12 ), it works does anyone know something about this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---