Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰] wrong height and width in android real device #1901

Closed
ansarikhurshid786 opened this issue Dec 22, 2021 · 11 comments 路 Fixed by #2058
Closed

[馃悰] wrong height and width in android real device #1901

ansarikhurshid786 opened this issue Dec 22, 2021 · 11 comments 路 Fixed by #2058

Comments

@ansarikhurshid786
Copy link

Description

This is library is perfect and growing. It is working perfectly in iOS and android simulator.

In Android real device facing following issue:
Capure or pick from gallery images getting wrong height and width(reverse) when i set maxHeight and maxWidth properties.

How to repeat issue and example

In Android real device facing following issue:
Capure or pick from gallery images getting wrong height and width(reverse) when i set maxHeight and maxWidth properties and portrait mode image.

launchCamera({
            includeExtra: false,
            mediaType: "photo",
            saveToPhotos: false,
            cameraType: "back",
            quality: 1,
            maxWidth: 1000,
            maxHeight: 1500
        }, this.commonCameraGalleryRespone);

response:

height: 1000
width: 750

Additional Information

  • Image Picker version: 4.6.0
  • React Native version: 0.63.4
  • Platform: Android (real device)
  • Development Operating System: MacOS Big Sur
@levino
Copy link

levino commented Jan 27, 2022

I guess this is because of exif rotation of the image. I am struggling to get the exif orientation after the user has taken a photo. But the behavior you are seeing is correct: Android devices always takes portrait pictures but adds a rotation property to the exif data.

@Komal7209
Copy link

Could this bug assigned to me , I can try solving this, and also pls do provide me with that code file link, where I can change the code

@Komal7209
Copy link

@ansarikhurshid786 Could you assign this bug to me

@ansarikhurshid786
Copy link
Author

I don't have rights to assign you bug. could you please and update repo.

@nica0012
Copy link

Any updates here? This is also happening to me on IOS. (videos taken from phone that are selected from the gallery)

@ArkanRomanPango
Copy link

response when you try to take photo from real android device. I got width and height from asset. Made photo with horizontal and vertical orientation but got the same response
image

@alariej
Copy link

alariej commented Nov 14, 2022

Same issue on Android (test device is a Samsung Galaxy S7). Portrait photos picked from the Gallery have the width and height mixed up. Landscape photos are OK. No problem on iOS.

@80prozent
Copy link

i am facing the same issue.

Just tried the fix provided by @GiovanniVisentiniCasavo

Seem to work correctly now, width and height are now correct on my samsung S9 for both Portrait and Landscape.

Would be great if someone could review the PR, so that it can be merged!

@Lizcq11
Copy link

Lizcq11 commented Feb 28, 2023

Can someone please review the PR and aprove it, seems like there is the solution, just need to be merged

@Johan-dutoit
Copy link
Collaborator

馃帀 This issue has been resolved in version 7.0.2 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

@dibyendu
Copy link

dibyendu commented Dec 27, 2023

Adding comment with reference to PR #2260.

On Android, the returned width and height are still swapped for images containing EXIF orientation 5(ORIENTATION_TRANSPOSE) and 7(ORIENTATION_TRANSVERSE).

Can be verified with the following test images:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants