1

images loaded using picasso.get().load(url) are rotated. I tried to use .apply { rotate(90F) } which does rotation for all images loaded from URL.

if the picture is taken in portait, rotating 90 works fine but if the image is taken in landscape this does not work.

Is there a way I could rotate picasso image based on exif.

this is the code I have at the moment

 Picasso.get().load(url)
            .apply { placeholderRes?.let { placeholder(it) } }
            .apply { if (resizeWidthRes != null && resizeHeightRes != null) resizeDimen(resizeWidthRes, resizeHeightRes) }
            .apply { if (convertToCircle) transform(CircleTransformation()) }
            .apply { rotate(90F) } //DOES NOT WORK FOR LANDSCAPE PICTURES
            .into(imageView)

Picture taken in landscape

enter image description here

Picture loaded in image view which is roatated

enter image description here

Any suggestions on how to use exif and rotate picasso image from url would be very helpful

Thanks R

BRDroid
  • 3,920
  • 8
  • 65
  • 143
  • "_but if the image is taken in landscape this does not work_" - I'm sure it works as intended and as per your instructions: the picture is rotated. The mistake in here is to expect a different outcome. Also please use full sentences with punctuation (especially question marks for questions); the text "_enter image description here_" is directed at you as author. – AmigoJack Feb 19 '22 at 14:11
  • As per a [comment on the ticket "EXIF support for downloaded images"](https://github.com/square/picasso/issues/846#issuecomment-796963795) you might want to read the [linked answer to "Android Picasso auto rotates image"](https://stackoverflow.com/a/66588700/4299358). – AmigoJack Feb 19 '22 at 14:22

0 Answers0