Rotating an image with orientation specified in EXIF using Python without PIL including the thumbnail

后端 未结 6 1268
太阳男子
太阳男子 2020-12-02 09:10

I have the following scenario:

  • I am sending an image from iPhone along with the EXIF information to my Pyhon socket server.
  • I need the image to be pro
6条回答
  •  离开以前
    2020-12-02 09:54

    If you're using Pillow >= 6.0.0, you can use the built-in ImageOps.exif_transpose function do correctly rotate an image according to its exif tag:

    from PIL import ImageOps
    
    image = ImageOps.exif_transpose(image)
    

提交回复
热议问题