uiimagepickercontroller - iPhone camera images are rotated when uploaded to web -


I am using UIImagePickerController to take a picture in Portrait mode on iPhone and save it on the Web. The photo appears in the picture on the phone, but rotates 90 degrees on the web.

If I download the photo and see it in preview (Mac) or Photoshop (Mac or PC) then it is again in the picture. In Windows Picture Viewer (PC) it has been rotated in the scenario.

Do I need to apply rotation transforms to image data before uploading? Do I have to remove that meta-data which is rotating it in Photoshop and Preview? The problem was that image rotation was added in the form of XF data in the photo, which is done by most browsers. There were two solutions that were not used:

  1. Apply rotation on the server side. I was using the Ruby plugin paperclip (by Thottbot) and the model had to include the auto-and-converter option in the has_attached_file command:

    is_tacket_file: photo,: convert_options => {: all => '-Outo-Orient'}

  2. Rotate the photo within the iPhone app. This was resolved in another stack overflow question; Rotation changes the meta-data with an image transform to call, thanks for @Swzy.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -