0

I'm resizing my images proportionally using this command:

from PIL import Image
basewidth = 700
im = Image.open('foto.png')
wpercent = (basewidth/float(im.size[0]))
hsize = int((float(im.size[1])*float(wpercent)))
im = im.resize((basewidth,hsize), Image.ANTIALIAS)
im.save("New_foto.png",optimize=True,quality=95)

Before I formatted my computer it was working perfectly. Now it's working in a way, but it's saving the photo with another position. Only pictures in portrait format, they pass as landscape, and I don't want that. Does anyone know what might be going on? I need install an additional package? Or how do I always save with the original position?

Curious G.
  • 701
  • 4
  • 17
  • Do you still uses `png` or maybe `jpg`? Maybe it is not problem with code but with images. Many cameras save `jpg` portrait images as landscape with special flag which informs image viewers to rotate it before displaying. – furas Sep 03 '21 at 13:12

0 Answers0