Android - Picasso image orientation changed - android

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

Related

In Android, Image is getting blur after zooming it by using chrisbanes PhotoView library

I want to display set of images in horizontal viewpager.
I have used the "chrisbanes PhotoView" library.
Everything is working well but after zooming any image the quality of images getting lose even for high resolution images.
The Size of image is 1440*2560
Please let me know, if I am missing something
Thanks you in advanced

Android ImageView not show perfect

I am using Picasso to show images from url. My issue is , when I used debug APK, all images in list and grid view show perfect, whenever I upload APK to play store and install Live app, some of image stretch height wise. I did not give width and height in layout. I am not able to figure out the issue. Please help.
Debug App
Live app
Screenshot from both app is added.
Try this Glide This is perfect for Url Image.
Add this library to your gradle file
implementation 'com.github.bumptech.glide:glide:4.11.0'
Glide.with(OurAppsActivity.this)
.load(image_url)
.into(your_ImageView);
Perhaps what you need is making images have fixed aspect ratio on all phones.
Customize ImageView: https://github.com/santalu/aspect-ratio-imageview/
Use ConstraintLayout: ConstraintLayout aspect ratio

Displaying an HD image

I have recently started to learn android application development. Now I have some troubles in the image insertion. When i use the default images (launcher_background) my application seems to work fine. But any time I try to insert a HD image the application seems to stop. This has been going on for quite a while now.
Mybe it's because your image size is too big if your image is too big you should change image width and height to size of the image view or device display
There are thred party libaries you can use like :
https://github.com/Piasy/BigImageViewer
For more information see the links below :
https://developer.android.com/topic/performance/graphics/load-bitmap.html
https://android.jlelse.eu/loading-large-bitmaps-efficiently-in-android-66826cd4ad53

Picasso displays in wrong orientation

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.

How does the JPEG orientation feature work?

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.

Categories

Resources