forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: evilc on August 17, 2005, 10:11:45 pm

Title: API ? Adding pictures to gallery programtically ?
Post by: evilc on August 17, 2005, 10:11:45 pm
What I would like is a way to tie coppermine into my open source project.
I need some system whereby I can insert a picture into the coppermine gallery and get a link (ID, whatever) back so I can register that picture as belonging to my program.
Imagine as if you were trying to add an upload image feature for the "post" page (ie the one I am using to write this post now) on a message board - the user could click the upload button that pulls up a browse window, you select the file and it inserts a bbcode img link to the image into the post.
Obviously on submit you would need to upload the image to coppermine, get back it's ID and assemble the bbcode img tag to link to it.

Is there some mechanism to allow things like this planned ?
Title: Re: API ? Adding pictures to gallery programtically ?
Post by: Aditya Mooley on August 18, 2005, 07:02:44 am
Here's the API for CPG
http://forum.coppermine-gallery.net/index.php?topic=17097.0

It's a very basic API which will allow you to upload the image and get the list of all the categories and its albums.
Title: Re: API ? Adding pictures to gallery programtically ?
Post by: evilc on August 18, 2005, 03:19:27 pm
nice, thanks.
Seems like it may well do what I want.
An Add Album call may be nice, so that my prog can add albums as needed...

One thing I saw that concerned me is that pictures seem to have a gallery and position Id for thier link.
The upload picture seems to return a PID.

Is it possible to link to a picture using just it's PID ? I would much rather do that as a PID would be correct even if the picture got moved surely.
 
Title: Re: API ? Adding pictures to gallery programtically ?
Post by: Nibbler on August 18, 2005, 03:48:24 pm
Yes, the pid based link is to displayimage.php?pos=-[pid]