Now my code write PNG, but I can't open it - errors of file. Without crooping all works, but I need crop png file. With my coords (no PIL box), and transparent images.
Image.open(imagefile)
#image = image.crop(crop_coords) #only work without cropping
image.thumbnail([x, y], Image.ANTIALIAS)
imagefile = StringIO()
imagefile = open(file_destination, 'w')
try:
image.save(imagefile, "PNG", quality=90)
except:
print "Cannot save user image"
Thanks for help.
I have noticed that problem is only for png files with indexed PNG alpha images.