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

Upload images and support jpg and png image format together.

1 Answer 126 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.
Bavya
Top achievements
Rank 1
Bavya asked on 09 Jul 2013, 05:05 AM
Hi,

I was using phonegap FileTranser API to upload images to my WCF server(KendoUI-Icenium project). I was able to upload, but the issue is I can upload either jpg or png images. Is this the way phonegap image upload will work? Its not possible to support both image format together?

function getImage() {
              navigator.camera.getPicture(uploadPhoto, function(message) {
                    alert('get picture failed');
                }, {
                    quality: 50,
                    destinationType: navigator.camera.DestinationType.FILE_URI,
                    sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
                    encodingType:  Camera.EncodingType = { JPEG : 0, PNG : 1}
                }
             );
            }   
This is the way I tried to get both format together. But it is not working. Please note that I have tested in Android phone..

Thanks,
Bavya.

1 Answer, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 09 Jul 2013, 11:52 AM
Hi Bavya,

 This is the way the Cordova Camera API is designed - you can take an image in one format at a time only. This is the relevant part of the Camera implementation.

 What you can do instead is to upload one version of the image to your server and there convert it to the other. However, if this isn't what you want, then you can submit an improvement request for the Camera API to Cordova's JIRA.

Regards,
Yavor Georgiev
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussion
Asked by
Bavya
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or