Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

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

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.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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

-----------------------------------------------------------------
John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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 ');

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

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

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]

Anton Artyukh5836028
Posts: 0
Joined: Wed May 08, 2013 12:57 pm

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

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.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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?

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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 ');

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

Hi, working on it.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

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.

John Herdean
Posts: 0
Joined: Tue May 14, 2013 3:56 am

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

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.

Return to “Issues”