This is a migrated thread and some comments may be shown as answers.

iOS Cordova 3.5.0 camera.getPicture targetWidth issue

8 Answers 366 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Žygimantas
Top achievements
Rank 1
Žygimantas asked on 07 Dec 2014, 09:28 PM
I use iOS 8.1.1 with the latest companion app.

If I pass  { 'destinationType': navigator.camera.DestinationType.DATA_URL} to the camera.getPicture method, it works file, but the image data size is huge.
I don't need high resolution and I decided to provide targetWidth and targetHeight options to get smaller photos.

But once I add these options like this: { 'destinationType': navigator.camera.DestinationType.DATA_URL, 'targetWidth': 480, 'targetHeight': 640} the camera.getPicture method returns nothing. No code in success or error callbacks is executed. Just nothing happens.

What might be wrong?

8 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 10 Dec 2014, 02:57 PM
Hi Žygimantas,

This is a known issue within the companion app which comes from the specifics of the Camera plugin and the location services on iOS8 devices.

We plan to push a fix to the companion app that works around this behavior. In the meantime, there is a simple fix you can apply in your application. You can add another CameraOptions property next to the one for targetWidth and targetHeight : encodingType: Camera.EncodingType.PNG:

var config = {
    destinationType: Camera.DestinationType.DATA_URL,
    targetHeight: 400,
    targetWidth: 400,
    encodingType: Camera.EncodingType.PNG
};

Give this a try and let me know if it helps.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Žygimantas
Top achievements
Rank 1
answered on 10 Dec 2014, 08:02 PM
Thanks! That's a good trick.
0
Tina Stancheva
Telerik team
answered on 11 Dec 2014, 11:39 AM
Hi Žygimantas,

I am glad it helps, but keep in mind that changing the encoding type to PNG will make your camera take pictures with no EXIF information (such as where the picture was taken). This is exactly the reason why this line helps overcome the issue until we address it.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
nalini
Top achievements
Rank 1
answered on 12 Jun 2015, 06:08 PM
I used the same option. Still it is unresponsive after image captured. any way to free the memory. 
0
Tina Stancheva
Telerik team
answered on 17 Jun 2015, 05:53 PM
Hi Nalini,

The issue discussed in this thread was resolved a while ago. Can you please submit a support ticket and attach your project there so we can investigate the issues you are having. We would also need to know the steps we can follow to reproduce the behavior you described.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
nalini
Top achievements
Rank 1
answered on 17 Jun 2015, 05:56 PM

Thanks, Tina.. I have resolved the issue by giving the targetheight.

Here is my working code 

navigator.camera.getPicture(onSuccess, onFail, {

                quality: 50,
targetWidth: 600,
targetHeight: 600,
encodingType: Camera.EncodingType.PNG,
                correctOrientation: true,
                destinationType: destinationType.DATA_URL
            });

 

 

0
Lingaraj
Top achievements
Rank 1
answered on 05 Feb 2016, 09:17 AM

Hi,

i am facing same issue .photo is not displaying after click on use photo option complete blank page appears.

here is my code .its hybrid application its working on android device fine problem with ios device only.

var config = {
    destinationType: Camera.DestinationType.FILE_URI,
    targetHeight: 400,
    targetWidth: 400,
    encodingType: Camera.EncodingType.PNG
};

0
Tina Stancheva
Telerik team
answered on 10 Feb 2016, 12:57 PM
Hi Lingaraj,

Can you replicate the issue in the Camera sample app. I've tried on my side but capturing photos seem to work as expected even with the configuration you specified. The photo is captured and then displayed in the app.

If you can replicate the problem, please submit a support ticket and provide us with a small sample where we can see the issue or with the list of steps we can follow to replicate it in the sample Camera app.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Žygimantas
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Žygimantas
Top achievements
Rank 1
nalini
Top achievements
Rank 1
Lingaraj
Top achievements
Rank 1
Share this question
or