Picasso.with(mContext).load(lPreviewData.getImage()).into(holder.lPreviewIV);
This is how I am rendering the image url to ImageView. Unfortunately when i render an image it was showing in landscape mode but the actual image is in portrait.
This is a problem with exif rotation handling in Picasso. You should either rotate the image in code or fix the source image to have the correct orientation without using exif rotation.
I should also mention that this problem only affects images retrieved via url.
Related
In my android application, we are using Picasso plugin to display the file in to the imageview. Please refer the below code.
val pf= File(photo!!.thumbnailPath)
Picasso.get()
.load(pf)
.into(imageView)
I am using latest Picasso plugin and in this code, if we select landscape image from gallery then the image will display fine on the ImageView. But if we select the portrait images then it will automatically change the orientation while displaying it on ImageView.
I knew this is the known bug in Picasso plugin and I tried lot of other possibilities and couldn't able to fix it. Can anybody have any idea about how to display all images in proper way in the ImageView without any orientation.
In above diagram car image as landscape and flower image as portrait mode. I need to fix that flower image (portrait mode) should display properly as it is in gallery.
Thanks
AK
I need to display images using Picasso library, keeping the original orientation.
I'm taking pictures using Camera or from Gallery, and then upload multiple images to server using Volley.
The problem is when images are loaded, they are rotated, i.e. orientation is wrong.
How can I rotate images in both portrait or landscape mode loaded from server?
Picasso.with(getApplicationContext()).load("http://:www..." + url).into(imageView);
I tried to get exif orientation from images on server using PHP exif_read_info, but Orientation is not specified.
To rotate by 90 degree use.
Picasso
.with(context)
.load("http://:www..." + url)
.rotate(90f)
.into(imageView);
I am building an app that relies on showing quite a few bitmap images taken from the camera. I want all of the images to show with a 90 degree (portrait) orientation, and I know how I can do this with the EXIF information provided with each image. Would it be a better idea for me to rotate the bitmap of an image to fit my needs right after it is taken and then send it to my server, or should I send the image to my server without rotating it and then whenever I pull it down, use the EXIF rotation provided with the image to rotate the image view I am displaying it in? I need a solution that is memory efficient and fast. Thanks.
Since bitmap is just a matrix with the some data in every cell it should have the same weight (in terms of mb) if it's portrait or landscape, in case you need the images to be in a 90 deg. tilt ALL the time I would probabley do it before sending it to the server since (by my logic) you would probabley pull it ALOT more than upload it (which will only happen once..) so saving it on the way you are going to display it will basically have no effect on it's weight consumption HOWEVER since you are going to display it alot (again, by my logic since you keep it in a server) saving it alreay rotated will probabley save some other clients the hassle from doing that themselves..
When I take a picture in portrait mode, the crop view automatically rotates it by 90 degrees. Does not seem to happen in landscape. Is there a way to prevent this
Change the file type from png to jpg
EDIT: Comments from Charles Caldwell, which explain why this answer is correct: "PNG files do not contain EXIF data which includes the rotation information. If the photo is taken as a PNG, switching to JPG could resolve the issue"
I do have some images (example) which will be displayed differently depending on the software I am using.
When I open the image in my browser, the picture loads from the right side to the left (in contrast to other images which are loading from top to bottom).
Browser:
When I display the same image in an Android Application (via UrlImageViewHelper) the image will be displayed with an rotation of 90°.
Android:
'Normal' Images (that are loading from the top downwards) are being displayed correctly in my application.
Questions
Where does the browser get the information about the orientation of the image?
How could I implement an Android ImageView that is aware of the original orientation of the image?
Try this:
Put the rotated jpeg in your res/drawable. Set an ImageView to use that. See what happens.
UrlImageViewHelper doesn't actually do special image loading. It just uses the BitmapFactory like it should.
This is very likely to be an Android framework/libjpeg bug where jpeg rotation EXIF tag is not being honored.