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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getImageMetaData width/height does not respect orientation on iOS #285

Open
1 task done
terrysahaidak opened this issue Apr 8, 2024 · 2 comments
Open
1 task done

Comments

@terrysahaidak
Copy link

Current behavior

When we get image metadata, it returns us imageWidth and imageHeight, but when we pick that image, the image picker returns flipped values. Since imageWidth and imageHeight are actually "default" orientation values. These values are matching the exif values where we have orientation.

Here is an example object:

{"ImageHeight": 3024, "ImageWidth": 4032, "Orientation": 6, "exif": {"ColorModel": "RGB", "DPIHeight": 72, "DPIWidth": 72, "Depth": 8, "Orientation": 6, "PixelHeight": 3024, "PixelWidth": 4032, "ProfileName": "Display P3", "extension": "jpg", "size": 387221, "{Exif}": {"ColorSpace": 65535, "PixelXDimension": 4032, "PixelYDimension": 3024}, "{JFIF}": {"DensityUnit": 0, "JFIFVersion": [Array], "XDensity": 72, "YDensity": 72}, "{TIFF}": {"Orientation": 6, "ResolutionUnit": 2, "XResolution": 72, "YResolution": 72}}, "extension": "jpg", "size": 387221}

And what picker returned me:

{"height": 4032, "width": 3024}

Expected behavior

I would assume that imageWidth and imageHeight would respect the orientation and would show the same values as image picker does, but the exif values should be the original values and the orientation if you really need it.

Platform

  • [] Android
  • iOS

React Native Version

0.72.9

React Native Compressor Version

1.8.24

Reproducible Steps And Demo

  • Take an image in portrait orientation on an iPhone
  • use expo image picker to get the image in JS with its width/height
  • use getImageMetaData to get metadata
  • the width and height in metadata are flipped
Copy link

github-actions bot commented Apr 8, 2024

👋 @terrysahaidak
Thanks for opening your issue here! If you find this package useful hit the star🌟!

@terrysahaidak
Copy link
Author

This seems to be true also for the getVideoMetaData but it does not have the orientation, here is an example response:

{"creationDate": "2024-04-02T20:49:56+0300", "duration": 3.0016666666666665, "extension": "mov", "height": 2160, "location": "", "size": 17938656, "width": 3840}

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

No branches or pull requests

1 participant