Page 3 of 6

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

Posted: Thu Jun 20, 2013 7:49 pm
by John Herdean

well, I wanted to make sure that the pic(s) are actually successfully stored in local storage, because my next task i want to work on is to send the pics to my server and I want to make sure that will not be any issue. So, even if its a long string, how I would i read it? And It would have to be from my iPhone or Android since Im taking pics from the phone..?


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

Posted: Thu Jun 20, 2013 8:05 pm
by Kateryna Grynko

Lets begin with implementing the codes described above :)


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

Posted: Thu Jun 20, 2013 8:24 pm
by John Herdean

my back end guy wants to know can we save them pics as normal image files instead of a byte stream? I'm using amazon web services and the way he wrote the code to receive the pics as multi-part files or he wants the front end to send the image files as a multi-part request? I even looked at your basic REST services and dont see that kind there...??


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

Posted: Thu Jun 20, 2013 8:43 pm
by Kateryna Grynko

Hi John,

This will be helpful:
http://stackoverflow.com/a/5100158


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

Posted: Thu Jun 20, 2013 8:43 pm
by John Herdean

Regarding the photoswiping question, i found i think a plugin from:

http://www.photoswipe.com

Im able to download a zip file, and they give me these instructions:

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

What to include:

The call:

// Set up PhotoSwipe with all anchor tags in the Gallery container
document.addEventListener('DOMContentLoaded', function(){

var myPhotoSwipe = Code.PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), { enableMouseWheel: false , enableKeyboard: false } );

}, false);

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

For the way I'm taking pics (above), how would I implement the zip file, 'What to include:', and 'The Call' from http://www.photoswipe.com ??


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

Posted: Thu Jun 20, 2013 8:45 pm
by John Herdean

BTW: theres two script lines after 'What to include:' - I guess its only visible when you click 'edit' for this comment


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

Posted: Thu Jun 20, 2013 8:50 pm
by John Herdean

I will try working on this with my back end guy in a little bit.


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

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

Sorry.. have to chime in here...
Storing pictures in LocalStorage is a bad idea. The pic is already stored on the phone and is accessible via simple phonegap functions as well as uploading to the server.
Localstorage size restrictions being the important issue here as well. A couple of pics and it will be full...


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

Posted: Thu Jun 20, 2013 9:28 pm
by John Herdean

ok Neil I see your point. There was no real good reason for local storage (at least not for this feature).

So, how would i be able to set up a service then to send the image files as multi-part (where-ever they are normally stored) with some other request parameters (just text - like 'id') to my server?


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

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

Sending pics via Jquery is very difficult. Not sure it can even be done with img_uri type.
Phone gap has a great file upload that works great! I have implemented it to upload users taken pics to php server.
Whats your server running?