I want to find a way to compress the image and keep it in the same orientation. My code:
def save(self, **kwargs):
super(Post, self).save()
if self.picture:
mywidth = 1100
image = Image.open(self.picture)
wpercent = (mywidth / float(image.size[0]))
hsize = int((float(image.size[1]) * float(wpercent)))
image = image.resize((mywidth, hsize), Image.ANTIALIAS)
image.save(self.picture.path)
Even if i use just this bit:
image = Image.open(self.picture)
and then save it without doing anything
image.save(self.picture.path)
it still gives my the picture with the changed orientation...