-
Notifications
You must be signed in to change notification settings - Fork 603
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
[Bug]: Wrong iOS photo exif data #2209
Comments
This issue relates to Camera functionality, which is part of |
Will there by a solution for this? |
This issue has been labeled as |
Hey @sakonn, |
Hello @OS-ricardomoreirasilva, Here is the outcome of the photo taken as a portrait. The {
"format": "jpeg",
"exif": {
"ApertureValue": "167/100",
"BrightnessValue": "0/100",
"ColorSpace": "1",
"ComponentsConfiguration": "???",
"Compression": "6",
"DateTime": "2024:12:06 18:50:20",
"DateTimeDigitized": "2024:12:06 18:50:20",
"DateTimeOriginal": "2024:12:06 18:50:20",
"ExifVersion": "0220",
"ExposureBiasValue": "0/1",
"ExposureMode": "0",
"ExposureProgram": "0",
"Flash": "16",
"FlashpixVersion": "0100",
"FocalLength": "4730/1000",
"FocalLengthIn35mmFilm": "0",
"FNumber": "1.79",
"ImageLength": "4624",
"ImageWidth": "3472",
"InteroperabilityIndex": "R98",
"JPEGInterchangeFormat": "812",
"JPEGInterchangeFormatLength": "39323",
"LightSource": "21",
"Make": "XXXXX",
"MaxApertureValue": "167/100",
"MeteringMode": "2",
"Model": "XXXXX",
"Orientation": "0",
"PhotographicSensitivity": "125",
"PixelXDimension": "3472",
"PixelYDimension": "4624",
"ResolutionUnit": "2",
"SceneCaptureType": "0",
"SceneType": "0",
"SensingMethod": "0",
"ShutterSpeedValue": "5058/1000",
"SubSecTime": "609213",
"SubSecTimeDigitized": "609213",
"SubSecTimeOriginal": "609213",
"WhiteBalance": "0",
"XResolution": "72/1",
"YCbCrPositioning": "1",
"YResolution": "72/1"
},
"path": "file:///storage/emulated/0/Android/data/io.ionic.starter/files/Pictures/JPEG_20241206_185014_2081679850067582195.jpg",
"webPath": "http://192.168.1.7:8100/_capacitor_file_/storage/emulated/0/Android/data/io.ionic.starter/files/Pictures/JPEG_20241206_185014_2081679850067582195.jpg",
"saved": false
} And here is the outcome of the photo taken as a landscape. The {
"format": "jpeg",
"exif": {
"ApertureValue": "167/100",
"BrightnessValue": "0/100",
"ColorSpace": "1",
"ComponentsConfiguration": "???",
"Compression": "6",
"DateTime": "2024:12:06 18:50:51",
"DateTimeDigitized": "2024:12:06 18:50:51",
"DateTimeOriginal": "2024:12:06 18:50:51",
"ExifVersion": "0220",
"ExposureBiasValue": "0/1",
"ExposureMode": "0",
"ExposureProgram": "0",
"Flash": "16",
"FlashpixVersion": "0100",
"FocalLength": "4730/1000",
"FocalLengthIn35mmFilm": "0",
"FNumber": "1.79",
"ImageLength": "3472",
"ImageWidth": "4624",
"InteroperabilityIndex": "R98",
"JPEGInterchangeFormat": "812",
"JPEGInterchangeFormatLength": "34979",
"LightSource": "21",
"Make": "XXXXXX",
"MaxApertureValue": "167/100",
"MeteringMode": "2",
"Model": "XXXXX",
"Orientation": "0",
"PhotographicSensitivity": "125",
"PixelXDimension": "4624",
"PixelYDimension": "3472",
"ResolutionUnit": "2",
"SceneCaptureType": "0",
"SceneType": "0",
"SensingMethod": "0",
"ShutterSpeedValue": "5058/1000",
"SubSecTime": "467467",
"SubSecTimeDigitized": "467467",
"SubSecTimeOriginal": "467467",
"WhiteBalance": "0",
"XResolution": "72/1",
"YCbCrPositioning": "1",
"YResolution": "72/1"
},
"path": "file:///storage/emulated/0/Android/data/io.ionic.starter/files/Pictures/JPEG_20241206_185045_8653160463096438101.jpg",
"webPath": "http://192.168.1.7:8100/_capacitor_file_/storage/emulated/0/Android/data/io.ionic.starter/files/Pictures/JPEG_20241206_185045_8653160463096438101.jpg",
"saved": false
} In this situation, the autorotate feature was disabled on my phone. |
So I did a bit more digging into the issue itself and would like to share you with some findings.
Considering all this, and regarding that the values are expected from an EXIF perspective, the presented values do make sense and changing them might lead to unexpected issues. |
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
The text was updated successfully, but these errors were encountered: