API to upload image?

wrlee

Joined: 2011-06-19
Posts: 10
Posted: Sun, 2011-06-19 09:08

New to Gallery, I've been going through the developer documentation. Nice start!

Can someone guide me on the approach I need to take to upload an image from an external app? I am building a mobile application that can upload images. I want to upload to Gallery3 and get the image's URL so that it can be references from a web page, elsewhere.

As I am learning about Gallery, it appears that I, first, need to find or create an "owner" for the image. What information would I need to find an existing user? How do I create a user dynamically, if needed? Is there an API for uploading an image?

For a start, just pointing me to the concepts I need would be helpful.

Thanks in advance,
Bill...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25945
Posted: Sun, 2011-06-19 15:33

I have never tried but have heard that people have had success with http://codex.gallery2.org/Gallery3:API:REST

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
wrlee

Joined: 2011-06-19
Posts: 10
Posted: Mon, 2011-06-20 04:52

I'd looked through that beforehand. It wasn't apparent that there is an API to upload an image file. Am I missing something?

 
dave8401

Joined: 2009-06-01
Posts: 129
Posted: Mon, 2011-06-20 12:29

I went through this pain before ... so I can help. The relevant example for uploading an image is here.

Are u coding for iOS (iPhone/iOS). If yes let me know if you want to join our forces.

 
wrlee

Joined: 2011-06-19
Posts: 10
Posted: Mon, 2011-06-20 18:26

Thank you Dave!

I am implementing an iOS uploader. I am just now learning about Gallery, so I feel very ignorant, at the moment. I can code up an iOS uploader. The complication, for me, is that I also need to create users and/or albums (I haven't decided) on the fly, since I am using Facebook for my users (so users are already registered to my app, but not necessarily in Gallery).

At the very least, I will need to create and manage some additional tables to keep track of information that I need (and perhaps to correlate the Facebook signin info with Gallery's).

Bill...

 
wrlee

Joined: 2011-06-19
Posts: 10
Posted: Wed, 2011-12-07 01:24

Reviewing past stuff...

Dave, I realized I hadn't confirmed that I would be willing to share code. I had it working in iOS (I've since moved the upload into Gallery3 to the server to keep the iOS client ignorant of the true destination). I can share that code with you, if you'd like. I did find it surprisingly slow to upload. I had to cut the size of the image down, to be usable. That is not a Gallery3 specific issue; it might be related to my technique in uploading (though I can't imagine how to speed it up).

Bill...