iOS 13 camera is not working as expected
Bug Report
Problem
On iOS 13 the camera is not working as expected.
What is expected to happen?
To save the image with content in the temp folder and to return the location.
What does actually happen?
The image is saved and the plugin returns the path but the image content is missing.
Information
Command or Code
I use the following settings to open the camera.
{
sourceType: camera.PictureSourceType.CAMERA,
destinationType: camera.DestinationType.FILE_URI,
quality: 92,
encodingType: camera.EncodingType.JPEG,
correctOrientation: true,
saveToPhotoAlbum: false
}
When I use camera.DestinationType.DATA_URL instead of camera.DestinationType.FILE_URI I get the base64 code.
Environment, Platform, Device
Tested on iOS 13 beta 6 & 7.
Version information
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.5
@ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 6.4.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 34 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v11.11.0 (/usr/local/Cellar/node/11.11.0/bin/node)
npm : 6.7.0
OS : macOS Mojave
Xcode : Xcode 11.0 Build version 11M392q
Checklist
- [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
I think there is a bug in iOS 13. On iOS 13.1 and xCode 11.0 beta 7, the issue is still available. Here is the fix: https://github.com/vlinde/cordova-plugin-camera-with-exif/commit/4afa1516b0037768a4c51dfc4c77a9d04f68b886 Is another plugin but the fix is the same.
@vlinde I made a PR to fix this: https://github.com/apache/cordova-plugin-camera/pull/501
@mevinDhun Technically your fix is correct, but I don't think is the best one because the metadata will not be included. On my app I use the camera with exif and in this case the exif data are missing. Today I fixed the issue completely, including the exif implementation.
Here is the new implementation: https://github.com/vlinde/cordova-plugin-camera-with-exif/commit/99465b4c078bac48f26eb28a90737396e7dfca92
@vlinde you are right. i made a few more changes to address this in my PR: https://github.com/apache/cordova-plugin-camera/pull/501/commits/e1d057d86d2a4e37a33c0cd18c65ccdaebf9cf5f Now i can have the exif in the images.
Any chance their might be an ETA on this fix?
I ran into this issue as well. A bit more information to help other folks find this. I was getting these two errors every time I took a picture:
getCFDataBytesAtOffset:1209: : *** ERROR *** CGImageSource was created with data size: 55447 - current size is only: 0
getCFDataBytesAtOffset:1217: : *** ERROR *** requested range: 0-4096 - is outside input CFData range (0-0)
When I downloaded my app's package, I found that there were 2 images being created in the /tmp folder every time I took a picture. The first one had my picture and the second was empty.
I installed @mevinDhun 's fork and it resolved the issue for me. Thank you Mevin!!!
Tested on: iOS 13 running on iPad mini 4. iOS 13 running on iPhone SE iOS 10 running on iPhone 5
@jfbloom22 did you try this on 13.1.3
I ran into this issue as well. A bit more information to help other folks find this. I was getting these two errors every time I took a picture:
getCFDataBytesAtOffset:1209: : *** ERROR *** CGImageSource was created with data size: 55447 - current size is only: 0 getCFDataBytesAtOffset:1217: : *** ERROR *** requested range: 0-4096 - is outside input CFData range (0-0)When I downloaded my app's package, I found that there were 2 images being created in the /tmp folder every time I took a picture. The first one had my picture and the second was empty.
I installed @mevinDhun 's fork and it resolved the issue for me. Thank you Mevin!!!
Tested on: iOS 13 running on iPad mini 4. iOS 13 running on iPhone SE iOS 10 running on iPhone 5
How to install @mevinDhun 's fork ?The cmd is?
@anubhavberry I did not test with 13.1.3. I was on one or two updates before that one. 13.1.1 or 13.1.2. I do know that I have users running well with MevinDhun's fork on 13.1.3.
@dythbj command is: ionic cordova plugin add https://github.com/spoonconsulting/cordova-plugin-camera.git
Why is this fix not merged?
Closed by #712