You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "dtsvn-thudk (via GitHub)" <gi...@apache.org> on 2024/04/01 09:08:37 UTC
[I] Cordova plugin camera get picture. metadata not found in cordova ios [cordova-plugin-camera]
dtsvn-thudk opened a new issue, #884:
URL: https://github.com/apache/cordova-plugin-camera/issues/884
# Bug Report
## Problem
Cordova plugin camera get picture. metadata not found in cordova ios
### What is expected to happen?
Get metadata data when taking photos on iOS
### What does actually happen?
When I upload a photo using Android, the photo has metadata information, but when I upload a photo using iOS, there is no metadata information.
I used the exifjs library (https://cdn.jsdelivr.net/npm/exif-js) to test and the results are as follows:
android:

ios:

## Information
I see @erisu has committed on this issue!
I see that cordova plugin camere version 7.0.0 mentions preserving metadata on ios.

### Command or Code
`
base64ToArrayBuffer: function(base64) {
base64 = base64.replace(/^data\:([^\;]+)\;base64,/gmi, "");
var binary = atob(base64);
var len = binary.length;
var buffer = new ArrayBuffer(len);
var view = new Uint8Array(buffer);
for (var i = 0; i < len; i++) {
view[i] = binary.charCodeAt(i);
}
return buffer;
},
snapPicture: function(callBack) {
navigator.camera.getPicture(successCamera, failCamera, {
destinationType: Camera.DestinationType.DATA_URL,
correctOrientation: true
});
function successCamera(base64) {
let arrayBuffer = base64ToArrayBuffer(base64Image);
let dataExif = EXIF.readFromBinaryFile(arrayBuffer);
if (dataExif && dataExif.DateTime) {
alert("Exif Date: " + dataExif.DateTime);
} else {
alert("Exif Date not found!");
}
}
function failCamera(message) {
app.preloader.hide();
}
},
`
### Environment, Platform, Device
Platform : ios: 17.4.1, ios: 16.2
Device: iphone 12, ipad gen 10
### Version information
- cordova-ios: 7.0.1
- cordova-android: 12.0.1
- cordova-plugin-camera :7.0.0
- exifjs: 2.3.0 (https://github.com/exif-js/exif-js)
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x ] I searched for existing GitHub issues
- [x ] I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Cordova plugin camera get picture. metadata not found in cordova ios [cordova-plugin-camera]
Posted by "lmarcelocc (via GitHub)" <gi...@apache.org>.
lmarcelocc commented on issue #884:
URL: https://github.com/apache/cordova-plugin-camera/issues/884#issuecomment-2338533397
I've made a patch where EXIF Metadata is available again. Let me know if you still need it and I can share. It will be nice to have someone else testing :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Cordova plugin camera get picture. metadata not found in cordova ios [cordova-plugin-camera]
Posted by "daniel-hung (via GitHub)" <gi...@apache.org>.
daniel-hung commented on issue #884:
URL: https://github.com/apache/cordova-plugin-camera/issues/884#issuecomment-2361869350
I have run into the same problem where iOS is not capturing the exif data. If you could share your patch, that would be great. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Cordova plugin camera get picture. metadata not found in cordova ios [cordova-plugin-camera]
Posted by "lmarcelocc (via GitHub)" <gi...@apache.org>.
lmarcelocc commented on issue #884:
URL: https://github.com/apache/cordova-plugin-camera/issues/884#issuecomment-2362029316
Please give it a try and let me know if it worked out for you.
[cordova-plugin-camera+7.0.0.patch](https://github.com/user-attachments/files/17065455/cordova-plugin-camera%2B7.0.0.patch)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [I] Cordova plugin camera get picture. metadata not found in cordova ios [cordova-plugin-camera]
Posted by "iPMisterX (via GitHub)" <gi...@apache.org>.
iPMisterX commented on issue #884:
URL: https://github.com/apache/cordova-plugin-camera/issues/884#issuecomment-2585158416
Line 877 in CDVCamera.m
try change `self.data` to `imageDataWithExif`
```
if (![imageDataWithExif writeToFile:filePath options:NSAtomicWrite error:&err]) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org