Page 4 of 6

Photo just taken, how to add to a photo album?

Posted: Thu Jun 20, 2013 9:41 pm
by Emmz

See this phonegap info.
http://docs.phonegap.com/en/2.4.0/cor...

Dont use base64 for image. There are tons of issues for that.
Specify FILE_URI as the 'Camera.destinationType' when taking picture.


Photo just taken, how to add to a photo album?

Posted: Thu Jun 20, 2013 11:25 pm
by John Herdean

Hi, so I think I can use this JS from Phonegap to upload files to my server:

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

Photo just taken, how to add to a photo album?

Posted: Mon Jun 24, 2013 6:07 pm
by John Herdean

Hello Marina/Katya,

as far as the Phonegap code that I'm considering using in my previous posting, you guys gave me this JS to run to arrange the photos the user just took:

Appery('load_pics').append('Image ');

However Neil is saying Dont use base64 for image. There are tons of issues for that. Specify FILE_URI as the 'Camera.destinationType' when taking picture.

so then would my new JS be like this (to arrange my pics):??

Appery('load_pics').append('Image ');


Photo just taken, how to add to a photo album?

Posted: Mon Jun 24, 2013 11:58 pm
by Emmz

Just to be clear. Its phonegaps recommendation NOT to use base64.
Quote From Phonegap
[quote:]
Note: The image quality of pictures taken using the camera on newer devices is quite good, and images from the Photo Album will not be downscaled to a lower quality, even if a quality parameter is specified. Encoding such images using Base64 has caused memory issues on many newer devices. Therefore, using FILE_URI as the 'Camera.destinationType' is highly recommended.
[/quote]


Photo just taken, how to add to a photo album?

Posted: Tue Jun 25, 2013 9:37 am
by Anton Artyukh5836028

Hi All,

I'm sorry for the delay.

If you don't like use base64 an localStorage you need to use File API: http://docs.phonegap.com/en/2.4.0/cor...

Plugins already included to the project and for Android we have set permission for access to the SD-storage as default. But please check this if isn't (permission WRITE_EXTERNAL_STORAGE).

You may combine answers above with File API for upload files.


Photo just taken, how to add to a photo album?

Posted: Wed Jun 26, 2013 12:59 am
by John Herdean

I just rewrote the JS (the code that engages the camera phone and displays them on the users screen) to reflect that to this:

Appery('load_pics').append('Image ');

with this code, the image the user just took doesnt appear any longer. Only a thin border around an empty space like this screenshot:

Image

before i changed JS code from this it was loading no problem:

Appery('load_pics').append('Image ');

is replacing "data.imageDataBase64" to "data.imageURI" (i even tried "file.imageURI" and with that thin border mentioned above didnt even appear) the correct way to rewrite this? or are there other settings in my mapping i would have to change as well?

I also changed the request parameters in the camera service: destinationType from Data URL to File URI and the encodingType from JPEG to PNG.

WHat am I doing wrong here?


Photo just taken, how to add to a photo album?

Posted: Wed Jun 26, 2013 5:03 pm
by John Herdean

Hello Marina/Katya,

any ideas how to get this code right? To make it work for using FILE_URI as the 'Camera.destinationType':?

Appery('load_pics').append('Image ');


Photo just taken, how to add to a photo album?

Posted: Wed Jun 26, 2013 5:05 pm
by Maryna Brodina

Hi, working on it.


Photo just taken, how to add to a photo album?

Posted: Wed Jun 26, 2013 5:41 pm
by Maryna Brodina

If you want to set destinationType from Data URL to File URI then everywhere in code we suggested you should use data.imageURI instead of data.imageDataBase64.


Photo just taken, how to add to a photo album?

Posted: Wed Jun 26, 2013 5:47 pm
by John Herdean

Marina, I did. Thats why I'm coming back to this code because the pics are not loading anymore. Please see my previous comments... Hopefully we can figure out what the issue is?? Thanks.