deepak kumar deepak kumar - 1 year ago 101
iOS Question

image rotated 90 degree after loaded from url in iOS?

I have an

.I am loading image on that imageview from a url.Now after image is loaded it gets roatated 90 degree.When i open image url on webbrowser then it works fine.Please sugesst how can i remove this issue.I am using below code for it

imageView.sd_setImage(with: URL(string: url), placeholderImage:UIImage(named:"image_icon"))

Note:I am using sdwebimage for loading image from url

Answer Source

Your image is carrying EXIF data. I guess you are getting data to upload using UIImageJPEGRepresentation which includes orientation information. Try using UIImagePNGRepresentation because png images does not carry orientation information. I had the same problem earlier. Try and reply if works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download