Skip to main content

Portrait image saved as a landscape image orientation

Answered

Comments

3 comments

  • Nadav Soferman

    Certain browsers automatically rotate images based on the camera orientation info. You can set the 'angle' transformation parameter to 'exif' either for dynamic transformations or as incoming transformation while uploading. See the following article for more details

    http://support.cloudinary.com/entries/23342872-Why-was-the-image-I-uploaded-rotated-by-90-degrees-

    In addition, it is recommended to use our PHP client library that handles signature generation, upload calls and transformation generation:

    https://github.com/cloudinary/cloudinary_php

     

    -1
  • Andrew Lam

    Dear Nadav

    I'm trying to access the link that you provided https://support.cloudinary.com/hc/en-us/articles/202520622-Why-was-the-image-I-uploaded-rotated-by-90-degrees-  but I received "You're not authorized to access this page.

    May I know how can I access to the page as I'm facing the same orientation issue.

    Thanks,

    Regards,

    Andrew

    0
  • Raz Ziv

    Hi Lam,

    Thank you for notifying us about the issue you are experiencing when trying to access this link. We will look into it.

    In the meanwhile, please find below the content of the article you were trying to access:

    Cloudinary does not rotate the images in default upon upload, we display the original image. Your local viewer is probably rotating these images automatically. In order to solve this you can use the EXIF-based auto rotation (camera information). Setting the 'angle' parameter ('a' for URLs) to 'exif' does the trick.

    The a_exif transformation can also be applied as an incoming transformation while uploading (so the file stored in Cloudinary is already auto rotated), so you can automatically rotate images based on camera orientation info, by setting the 'angle' parameter to 'exif' or adding 'a_exif' to transformation URLs. (e.g., :angle => :exif in Ruby on Rails and similarly in other development frameworks).

    For example: The original image (scaled down):

    http://res.cloudinary.com/demo/image/upload/w_320/exif_sample.jpg

    Original

     

    The resulting image with automatic rotation: 
    http://res.cloudinary.com/demo/image/upload/w_320,a_exif/exif_sample.jpg

    Auto rotated

    -1

Post is closed for comments.