Mahavir     Aug,17 2017

Orientation Issue with iOS Image Upload (Part-2)

Just recently in the past a blog published on image orientation issue with iOS image upload, after that  we again experienced similar type of issue once previously image orientation issue already fixed for lucee CFML.

 

Again, Carried a few test methods to reach up to cause of the strange issue, finally found the cause and solution to fix it.

 

Usually, photos taken on apple device adds the orientation rules to EXIF metadata with captured images, so based on metadata information view photos rotation can be corrected.

 

Generally, we get the value like “Left side, bottom (Rotate 270 CW)” as orientation and using regular expression Getting rotation angel value and based on that rotate image to make it correct.
 

 

Below is the case when iOS user try to upload an image using different iPhone version then received different orientation value like “3”,”6” or “8”.
 

 

We found below page that will explain meaning of this “3”,”6” or “8” orientation value.

http://sylvana.net/jpegcrop/exif_orientation.html

 

Information on above page helped to understand orientation value and its meaning and update the code logic with this new solution to make it work perfectly.