npm version: 10.8.2
node version: v20.17.0
pod version: 1.13.0
iOS version: 17.4.1
ios device: iPhone SE 2nd generation
Platforms Affected
[X] iOS
[ ] Android
[ ] Web
Current Behavior
I am developing a data collection app where data is collected primarily in the form of photos which are later processed. To make postprocessing more straightforward it is required that they are taken in portrait mode (not in landscape). So, I am trying to figure out a way to restrict taking pictures which are landscape-oriented. I have not found any suitable setting for that, so now I am trying to disable saving photos that are wider than higher (landscape by this logic) based on the photo metadata. Photos are taken by the capacitor camera plugin when taking the photos I have found out that information about the photos taken in the iOS app is incorrect.
Portrait photo taken in the ios app:
And the related exif metadata about this photo which are returned by the plugin:
In my code, I am trying to compare PixelXDimension and PixelYDimension from the metadata and calculate if the photo is landscape or portrait. The problem is that these values are the same for both photos although they have different orientations.
On the contrary, the same photos taken with the android app return the expected result.
Landscape photo metadata from an android app:
I expect to get proper photo dimensions based on the photo orientation. So if the photo is taken landscape I expect to get the XDimension wider then the YDimension. And if the photo is taken as a portrait than the YDimension should be bigger than XDimension.
Capacitor Version
π Capacitor Doctor π
Latest Dependencies:
@capacitor/cli: 6.1.2 @capacitor/core: 6.1.2 @capacitor/android: 6.1.2 @capacitor/ios: 6.1.2
Installed Dependencies:
@capacitor/cli: 6.1.2 @capacitor/core: 5.5.1 @capacitor/android: 5.5.1 @capacitor/ios: 5.5.1
[success] iOS looking great! π [success] Android looking great! π
Other API Details
Platforms Affected
Current Behavior
I am developing a data collection app where data is collected primarily in the form of photos which are later processed. To make postprocessing more straightforward it is required that they are taken in portrait mode (not in landscape). So, I am trying to figure out a way to restrict taking pictures which are landscape-oriented. I have not found any suitable setting for that, so now I am trying to disable saving photos that are wider than higher (landscape by this logic) based on the photo metadata. Photos are taken by the capacitor camera plugin when taking the photos I have found out that information about the photos taken in the iOS app is incorrect.
Portrait photo taken in the ios app:
And the related exif metadata about this photo which are returned by the plugin:
Landscape photo taken in the ios app:
And the related exif metadata about this photo which are returned by the plugin:
In my code, I am trying to compare
PixelXDimension
andPixelYDimension
from the metadata and calculate if the photo is landscape or portrait. The problem is that these values are the same for both photos although they have different orientations.On the contrary, the same photos taken with the android app return the expected result. Landscape photo metadata from an android app:
Portrait photo metadata from an android app:
Expected Behavior
I expect to get proper photo dimensions based on the photo orientation. So if the photo is taken landscape I expect to get the XDimension wider then the YDimension. And if the photo is taken as a portrait than the YDimension should be bigger than XDimension.
Project Reproduction
https://github.com/sakonn/probable-octo-invention
Additional Information
No response