Search…

X3 Photo Gallery Support Forums

Search…
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

API / Automation

13 May 2012, 20:40

Hello Everyone!

Is there a way to perform a "Create Missing Thumbnail" for a folder via an API or some behind-the-scenes link? I remember a long time ago there way a way to call certain features via a querystring variable that displayed reporting information (read only) if I remember correctly. However I lost all documentation of this when a hard drive crashed...

Any help would be great.

Thanks!!
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

Re: API / Automation

14 May 2012, 08:35

This is the Imagevue API at the moment: https://www.photo.gallery/demo/x2/?a=index

You can only create thumbnail for a singe Image from frontent without being logged in. Logged in user can operate through this link:

/iv-admin/index.php?c=publish&publishData[path]=pictures1&publishData[thumbnails]=recreate|create

plus add values for custom thumbnail sizes: &publishData[width]=200&publishData[height]=100
and resize: &publishData[resizetype]=croptobox|resizetobox
firedev.com
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

14 May 2012, 20:37

Nick - thank you for your quick reply! I do, however, have two additional questions (hopefully you don't mind ;):

1) Is there a way to pass username and password via the querystring information?

2) From the XML API page you provided I didn't see a function (?) that allows me to update the title attribute of a folder - is this possible?

Thanks again!

- Josh
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

Re: API / Automation

14 May 2012, 23:01

Yes you can add the password as &login=xxxx&password=xxxx, but this is not secure so I don't recommend this.

The API that shows on ?a=index command is for reading data only. We don't have API to change data. If you want to update the title attributes you will have to use POST request otherwise it ends up in an infinite loop. Basically simply mimic the form on the admin page:

/iv-admin/?path=pictures1/&newdata['title']=NEWTITLE

But as I said, while this will change the title, provided you are logged in or also specify the login and password, it will end with an infinite loop, so you will have to send the newdata using POST request. You can actually check the forms in admin page and see what data we send to admin.

Can I ask – what are you trying to make?
firedev.com
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

15 May 2012, 10:40

Thank you again!

As far as what I am doing... I created a standalone image selection and upload tool for Imagevue. We (my wife and I) use Imagevue for our family photo album and she continued to have issues remembering how to process the images before uploading, creating folders, renaming title, etc. So this tool allows her to select the folder containing all the original images (from digital camera), shows a preview with EXIF orientation, allows rotation is EXIF is missing or incorrect and finally allows placement of the image in one of the Imagevue folders. Oh, it also allows the creation of new folders. Then the upload section of the code processes the image (resizes and rotates via ImageMagick) and then FTP uploads the image to our web site.

Because I'm uploading the images via FTP thumbnails are not created at first, which was the reason for my first post. BTW, it worked perfectly. Entering the title attribute is desired because she has the ability to add folders as well - although Imagevue doesn't know anything about them. While she ~could~ (ahem) just log into the beautiful management section and add the title - well, I'll just stop there. :P

- Josh

(sorry for this rough response - replying from an iPhone in a moving car. Yay me!)

*Updated with image
Attachments
OurImageManager.jpg
Screenshot
OurImageManager.jpg (77.66 KiB) Viewed 12497 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14002
Joined: 30 Sep 2006, 03:37

Re: API / Automation

17 May 2012, 09:29

lowray1975 wrote:As far as what I am doing... I created a standalone image selection and upload tool for Imagevue.
Thats pretty damn cool, and we have had some similar ideas for some time. Keep us updated!
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

Re: API / Automation

17 May 2012, 10:25

Wow this is super advanced, but you don't need to worry about thumbnail creation at least, thumbnails are created automatically as soon as you open the folder in frontend.
firedev.com
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

18 May 2012, 14:41

Thanks guys! I'll keep you posted! :D
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

24 May 2012, 14:54

Nick wrote:If you want to update the title attributes you will have to use POST request otherwise it ends up in an infinite loop. Basically simply mimic the form on the admin page:

/iv-admin/?path=pictures1/&newdata['title']=NEWTITLE
I've been successful at updating the Title and Description of a folder which, of course, made me think it it was possible to update the Title and Description of an image. I tried just adding the image name to the path although that didn't seem to work. Any suggestions?

As always, thank you!!!
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

Re: API / Automation

30 May 2012, 03:41

I don't see why it wouldn't work. These are the values being sent in the POST request when you are editing the image description:
Code
path:pictures1/lighthouse.jpg
newdata[title]:Lighthouse
newdata[description]:Lighthouse on the beach
You can just check the form on the edit image page to see that there is no black magic behind the scenes.

Did you ever thought about sharing your ImagevueAdmin.exe with the world by the way?
firedev.com
 
JK4U
Posts: 13
Joined: 28 Apr 2011, 10:54

Re: API / Automation

30 May 2012, 10:25

Yeah! I would even pay for that...instead of ACDSee-ing thru my pix all the time... ::]
Well done to you, sir!
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

30 May 2012, 10:51

Nick wrote:Did you ever thought about sharing your ImagevueAdmin.exe with the world by the way?
Absolutely - although it's still rather rough around the edges - give me about a week and I'll post something. :D
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

30 May 2012, 12:29

Nick wrote:I don't see why it wouldn't work. These are the values being sent in the POST request when you are editing the image description...
Yeah, I'm not sure why it isn't working either. I can successfully update the title and description of a folder although not the same for an image. The only difference I found is that the URL for an image update has "c=file" and the folder does not.

Stuck. :(
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

Re: API / Automation

31 May 2012, 01:11

This works:
Code
<form method="post" action="/iv-admin/index.php?c=file&path=pictures1/lighthouse.jpg&login=admin&password=test">
	<input type="text" name="path" value="pictures1/lighthouse.jpg"><br/>
	<input type="text" class="text" name="newdata[title]" value="TEST"><br/>
	<textarea name="newdata[description]">TEST</textarea><br/>
	<input type="submit" name="save">
</form>
But there are some caveats.
1. There should be the name="save" for this to work.
2. Login and password should be in the GET part otherwise it will try to login and redirect you
3. POST[path] tells imagevue which image to edit, but then it shows the page from the GET[path], if GET[path] is omitted it will show the root of the admin folder instead.

I admit this is clunky, but it wasn't meant to be used from an external application that's why some things behave the way they are.
firedev.com
 
lowray1975
Experienced
Topic Author
Posts: 137
Joined: 26 Jul 2008, 08:04

Re: API / Automation

01 Jun 2012, 16:17

Nick wrote:I admit this is clunky, but it wasn't meant to be used from an external application that's why some things behave the way they are.
I completely understand. Although with that said, what's the possibility of adding a write API section that will make it easier for all the third party developers? :grin: It could be simple enough to only support the ability to update the title and description. Since it could be HTTP GET based the accepted querystring parameters could be login, password, title, description and path. It would return a simple pass/fail acknowledgement.

I would have absolutely no problem donating/paying for this to be included! :D