Toblerone
Posts: 0
Joined: Wed Aug 07, 2013 5:08 pm

Save camera picture to gallery/camera roll?

How do we automatically save a picture taken with camera to the users gallery/camera roll? I checked out the phonegap documentation and according to that setting

saveToPhotoAlbum: true

Should do it when desitnation is FileURI, but no matter what I try it won't save there.

I've tried all kinds, as well as calling phonegap api directly like this

Code: Select all

     navigator.camera.getPicture(onPhotoFileSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI, saveToPhotoAlbum: true }); 

But nothing seems to work to save directly to camera roll on my ipad.

Anyone had any luck?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Save camera picture to gallery/camera roll?

If you tried the API directly and it still not working...maybe there is something specific to iPad. You might want to post this question on PhoneGap forum.

Ahmet
Posts: 0
Joined: Wed Jul 23, 2014 12:48 pm

Save camera picture to gallery/camera roll?

I have the same problem., HOw can I upload a photo taken by camera to the users phone GALARY : saveToPhotoAlbum

Thanks,
Ahmet

Ahmet
Posts: 0
Joined: Wed Jul 23, 2014 12:48 pm

Save camera picture to gallery/camera roll?

Please Tell me HOW to save a picture taken from CAMERA to the FILESYSTEM of the user : photo galaery. SAVE the picture to the USERS phones file system: say GALERY.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Save camera picture to gallery/camera roll?

Hi Ahmet -

To save picture into the device file system you will need to use Cordova File API: http://cordova.apache.org/docs/en/3.0...

Ahmet
Posts: 0
Joined: Wed Jul 23, 2014 12:48 pm

Save camera picture to gallery/camera roll?

Hi illya,

Thanks for the URL, but actually I'm looking for a solution to save a camera picture to APPRY.IO database so I can use it with the OCR functionality.

The OCR API want's a JPEG file it does no matter where it comes from. So I think it is easier if I save the camera picture to APPERY.io FILE database and for the OCR I wil ask the JPEG picture back from APPERY.IO files system, In this case I do'n t need to save the picture to the users FILE system. It is easier to read from the APPERY.IO database. Only restriction is that I need a JPEG file . I saw that the cordava plugin takes care for this issue, With the cordova upload file option you can upload a CAMERA picture to APPERY.io FILESYSTEM (database) as a JPEG file. The last item "AS A JPEG FILE" is the main issue.

The only unsolved issue is "How to change the name of the JPEG which is saved by cordaba file upoad service. but this is a small issue.

Thanks, for now, problem is (almost) solved.

Ahmet
Posts: 0
Joined: Wed Jul 23, 2014 12:48 pm

Save camera picture to gallery/camera roll?

Hi my problem is still not solved,
I have implemented the cordova FIle upload api,from the plugin "Upload File to Database:

This file uplad gives me a http link like:
https://api.appery.io/rest/1/db/files...');

and I;m using the OCR API: The Call to the API looks like: (Javascript at Button click:)

-------------------------------------------------------------------------------------------------

function uploadFiles(url, files) {
console.log(url, files);
console.log('sending data');
var formData = new FormData();

formData.append('image', files[0]);
formData.append('language', 'en');
formData.append('apikey', 'cCXXXXXXuy');

var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);

Code: Select all

 $('.translation_text').text('Translating. Please wait ... '); 

xhr.onload = function(e) {
console.log(this.response);
$('.translation_text').text(this.response);
};

Code: Select all

 xhr.send(formData); 

}

uploadFiles('http://api.ocrapiservice.com/1.0/rest...', $('input[type="file"]')[0].files);

-------------------------------------------------------------------------------------------------

This solution with "uploadFiles(url, files)
is used to oplad a JPEG file from FILE system of a MOBILE divice,

I want to use the DATABASE URL which looks like:

'https://api.appery.io/rest/1/db/files...'

So the question is how can I replace : $('input[type="file"]')[0].files with

https://api.appery.io/rest/1/db/files...

Actually OCR API wants from me:: Image, Languge and APIKEY,

Language and APIKEY are oke , but what can I do to replace "input file " solution with the http solution like

'https://api.appery.io/rest/1/db/files...'

Thanks,
Ahmet

Ahmet
Posts: 0
Joined: Wed Jul 23, 2014 12:48 pm

Save camera picture to gallery/camera roll?

Hi I see that I can use the cordova "upload file to database" and from there webupload . I followed the :"File Upload" method.

2 issues : The FILE UPLOAD methode did work, but not the WEB upload,

Secondly how can I use OCR call in combination with WEB UPLOAD?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Save camera picture to gallery/camera roll?

Hello,

1) Please read follow topic:
https://getsatisfaction.com/apperyio/...
2) You can found library fo OCR, e.g: http://antimatter15.com/ocrad.js/demo...

ahmet Karamanli
Posts: 0
Joined: Fri Aug 08, 2014 6:47 pm

Save camera picture to gallery/camera roll?

Hi, If I'm using the "input" component from APPERY.IO and ask the user to choose a image file from his/her phone then I know how to call the OCRAPI. let's call this : "INPUT Image from DEVICE"

OCR call:
formData.append('image', files[0]); <<<<<<<<<<<< with :

https://api.appery.io/rest/1/db/files...

Return to “Issues”