Command line tools? Command line tools?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Command line tools?

Started by adameros, December 27, 2004, 10:55:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adameros

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?

Joachim Müller

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

peda

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!

Joachim Müller

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.