[Image Utils Mobile] Rotate an image on Button Click
Forge component by Harlin Setiadarma
Application Type


I am using Image Utils Mobile Forge component to resize an image before uploading it as a user profile pic.

On testing, i noticed that in some images, the photo is oriented side ways so i want to have an option to rotate the image on click of a button. I tried the GetOrientation and FixOrientation. But it is always returning 0 as the return and not doing anything.

Can someone please help me how i can rotate the image?

Hi learn it,

As a quick note, did you read the following few rules on homepage of the component?

  1. GetOrientation: get orientation of image file (only source binary data with EXIF info)
  2. FixOrientation: fix image orientation by orientation input parameter or automatically without orientation input parameter (only source binary data with EXIF info)



  • GetOrientation will failed if used on Resize/Crop image binary data output, use it on original image binary data.

Without knowing how you did the implementation it could be the case you have one of the usecases above. If this is the case you could look into the forge to see if a component suits your needs.



Thanks @Bart Nooijens 

Yes, that is the limitation of my plugins.

You should get orientation on original image with EXIF data intact.

Or, you can supply orientation parameter in FixOrientation (value ranged from 1-8).

You can read EXIF orientation value here: http://sylvana.net/jpegcrop/exif_orientation.html

I don't have IOS device, so all testing was done on Android device.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.