forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: adameros on December 27, 2004, 10:55:01 pm

Title: Command line tools?
Post by: adameros on December 27, 2004, 10:55:01 pm
I have a number of directories of images I would like to add to my Coppermine archive, but rather than having to sit and load directory by dorectory to the archive, I would like to use some sort fo command line tools.

All the directory names match what I will name the albums, so I would love it if there were two commands that did the following:

albumcreate owner group pulic/group/private albumname
imageadd owner albumname imagefile

Then I could do something like this:
cd /archive
foreach a ( * )
  albumcreate adam friends group $a
  imageadd adam $a $a/*
end

Then I could go take a nap for a few hours and when I get back up all the images would be loaded.

This will make migration from anyother gallery program to Coppermine a breeze. Has anyone written anything to do this?
Title: Re: Command line tools?
Post by: Joachim Müller on December 28, 2004, 05:04:37 am
such a script hasn't been written yet (it'd require shell access to your webserver and in-depth knowledge both of mySQL and ImageMagick to accomplish a command line tool, which could of course only be used by a handfull of people, since most users are webhosted). Every PHP script would time out if you were going to add hundreds of pics in one go. Did you have a look at the batch-add tool (the recommended upload method for coppermine site admins is ftp-upload and batch-add). It won't create albums for you though, but it'd be rather easy to code a php script that crawls through a defined folder structure and creates categories and albums that matches the folder structure (although you'd have to create a script like that on your own, as I doubt someone here will). What amount of pics are we talking about?

Joachim
Title: Re: Command line tools?
Post by: peda on May 18, 2005, 09:04:32 am
I recently wrote a simple Perl script for adding photos in my gallery via command line ... If you are interested, I can send you/post this script. It
is still very beta ...
Currently this script searches all files in a directory with a .jpg-extension, takes each photo, resizes it (via GD library), reads exif data and
adds everything in the mysql database to a given categorie and album.
There are also command line scripts to add an album/categorie!
Title: Re: Command line tools?
Post by: Joachim Müller on May 18, 2005, 09:32:06 am
We're definitely interessted in such a script, please attach it to your reply (using "Additional options" when composing your message).
You might as well want to take a look at Batch add with automatic album/cat structure from directory tree. (http://forum.coppermine-gallery.net/index.php?topic=13949.0)