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

iOS 13 camera is not working as expected #492

Closed
3 tasks done
vlinde opened this issue Aug 23, 2019 · 11 comments
Closed
3 tasks done

iOS 13 camera is not working as expected #492

vlinde opened this issue Aug 23, 2019 · 11 comments

Comments

@vlinde
Copy link

vlinde commented Aug 23, 2019

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 (cordova-lib@8.1.1)
   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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@vlinde vlinde changed the title iOS 13 camera not working as expected iOS 13 camera is not working as expected Aug 23, 2019
@vlinde
Copy link
Author

vlinde commented Aug 29, 2019

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: vlinde/cordova-plugin-camera-with-exif@4afa151
Is another plugin but the fix is the same.

@l0stpenguin
Copy link

@vlinde I made a PR to fix this:
#501

@vlinde
Copy link
Author

vlinde commented Sep 13, 2019

@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: vlinde/cordova-plugin-camera-with-exif@99465b4

@l0stpenguin
Copy link

@vlinde you are right. i made a few more changes to address this in my PR:
e1d057d
Now i can have the exif in the images.

@BKHines
Copy link

BKHines commented Sep 26, 2019

Any chance their might be an ETA on this fix?

@jfbloom22
Copy link

jfbloom22 commented Oct 5, 2019

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

@anubhavberry
Copy link

@jfbloom22 did you try this on 13.1.3

@dythbj
Copy link

dythbj commented Oct 21, 2019

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?

@jfbloom22
Copy link

@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

@pc-partner
Copy link

Why is this fix not merged?

@erisu
Copy link
Member

erisu commented Mar 22, 2022

Closed by #712

@erisu erisu closed this as completed Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants