Batch import albums?

jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Wed, 2002-10-30 19:26

I have a large list(around 1000) of directories all with images ready to import into gallery, each directory will be it's own album within gallery. As far as I know, the only way to enter these into gallery is to click: new album..add photos..paste in the directory..submit url or directory..add files...wait for it to process and dismiss.

Anyone know of a workaround, hack, trick, or feature that will save me from doing this 1000 times over. Call me lazy, but this is too much repitition for this day in age.

Thanks,
Jeremy

 
jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Thu, 2002-10-31 19:21

:mad:

 
jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Sat, 2002-11-02 15:55

I would love it if someone replied, even if it was something like "you lazy idiot" or "no"

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Sun, 2002-11-03 08:26

Hi

I feel your frustratration! I guess everyone is out enjoying the weekend, or maybe someone hasn't come along yet that knows the answer.

I wish I did, but alas....I don't... :sad:

 
kvdb

Joined: 2002-10-10
Posts: 29
Posted: Sun, 2002-11-03 11:59

Hi,

There's a tool where you can batch upload pictures with.
It will certainly be of some use to you. If you're lucky it even supports directory structures, but that I don't know because I haven't used it lately.
You can download it at: http://sourceforge.net/projects/gallery

 
jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Sun, 2002-11-03 14:06

Thanks for the responses guys(gals?)

kvdb, are you refering to gallery remote?
great tool, but unfortnately not what I need here. The images are already uploaded and arranged neatly in directories on the server and I have a list of all the directories. I need to make each of those an album in gallery.

I'm thinking that I can manually create the same structure that gallery uses there's gotta be some way I can integrate the albums into my gallery without using any of the gallery import features. I haven't tested this out yet, but I'll report back here if the results are good. I figure there's gotta be someone else here looking for the same thing.

Hope you're all enjoying your weekends. I'm not (I work Sat-Wed :cry: DOH!)

Later,
J

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 313
Posted: Mon, 2002-11-04 18:58

Maybe you can use the <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpWiki&amp;file=index&amp;pagename=UPDATED%21%20Addimage" TARGET="_blank">Addimage Script</A><!-- BBCode End -->.

Good luck!

 
jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Wed, 2002-11-06 04:02

BorgKing,
You rock. Just took a peek at that code, and that looks along the lines of what I need. I'll post back my with results, and share the code if I change.
Thx,
J

 
Sire

Joined: 2002-08-28
Posts: 22
Posted: Thu, 2002-11-07 08:52

It would be nice if there was a solution where Gallery automatically recognized new albums moved into its /albums directory. Somewhat like how it upgrades existing albums from 1.3.1 to 1.3.2

Is this possible ?

 
jwaltz666

Joined: 2002-10-30
Posts: 6
Posted: Sun, 2002-11-24 15:49

Well, with that addimage.pl I can import directories into existing albums via the command line... Still searching for a way to add albums though. Anyone know how to do this?

Here's a code snip for adding a directory of images.

for i in `find /path/to/image/dir -type f -name "*.jpg" ` ; do perl addimage.pl -l gallery.url.com -a albumname -u username -p password -f $i; done

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Tue, 2002-12-03 13:40

I was looking for somthing along those lines also, however addimage.pl, I can not find, I found adddir.pl, however when I try and run it:

bash-2.05$ adddir.pl
or when I do:
bash-2.05$ adddir.pl - h

I get this:

Quote:
Can't locate Getopt/Simple.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at /home/theshane/www/adddir.pl line 28.

Line 28 is:

Quote:
use Getopt::Simple;[/qoute]

My server info:
Operating System Linux
Kernel Version 2.4.9-31enterprise
Apache Version 1.3.26 (Unix)
Perl Version 5.006001
PHP Version 4.2.3
MySQL Version 3.23.53a
Path to Perl /usr/bin/perl

Any ideas?
Thank you

Does the perl module on my sever need to be upgraded?
Hmmm

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Tue, 2002-12-03 15:49

My updated adddir.pl script allows you to create new albums.
You do, however, need a patched copy of gallery_remote.php for
it to work. I think I have links to both at http://sexorcisto.net/gallery-patch/

Someone posted a link to their version of an altered adddir.pl script someplace
in the forums that works differently then mine, you'd have to do a search.

Mine isn't terribly well rounded as I just updated for a specific need at the
time. As to it not working, I don't know, try re-installing/upgrading your
GetOpt module.

 
phylo

Joined: 2002-09-25
Posts: 19
Posted: Mon, 2002-12-16 03:34

I cant get this script to work properly... It wont recurse the subdirectories any more..

here is what I enter:
# adddir.pl -l http://www.photoliciousphotography.com/clubdesmo/gallery -a December_2002 -u admin -p password -d /path/to/my/images
Logging in... Successful.
Fetching list of albums (may be slow)... Fetched.
Found 2 files in /path/to/my/images
Uploading image Club_Desmo_12-11-02... Successful.
Uploading image Club_Desmo_12-12-02... Successful.
** Uploaded 2 images from /root/desmo/

There are 1800 images in several sub directories that need to be uploaded...

I was using the 1.o beta script and it worked fine with gallery version 1.3.cvs9 or something like that. I upgraded to 1.3.2 and down loaded the latest adddir.pl then fixed it. (you forgot to put a semi colon at the end of line 313. and now the script works but no longer recurses sub directories?? I am not a programmer and have no idea how to fix it my self, but I need this to work badly.. I upload an average of 4 to 5K images a month and usualy in bathces of 1500 plus images at onece. Gallery remote doesent do what I need it to.. The old adddir.pl script worked beautifuly.. I also applied the patch to gallery_remote.php

Any help would be greatly appreciated..

THanks
Phil

 
rscanon

Joined: 2002-12-12
Posts: 1
Posted: Tue, 2002-12-17 07:18

It looks like the link to the adddir.pl script doesn't call your new code in gallery_remote (new-album). Is there another version somewhere?

 
arune
arune's picture

Joined: 2002-12-22
Posts: 13
Posted: Sun, 2002-12-22 18:22

Vallimar:
1) The adddir.pl found here: http://sexorcisto.net/gallery-patch/ does not seem to use the new-album function as the remote_gallery.patch (this has allready been pointed out by rscanon)

2) The same adddir.pl misses a semi-colon (as pointed out by phylo)

(This post was fun, I just wrote what other ppl had said before, if they would have been fixed it would have saved me some hours of messing around)

Anyways, I have spend a total of ~10 hours of configurating so that I can add files with prompt, I would be happy if other users didn´t have to go through that.
It is a very complicated way to use adddir.pl as it is perl, it has depencies (getopt-simple) and is not even finished. I think I´ll make an online-guide on how to do what I have almost done, just as soon as I get it to work. (just the album-creation left)
/Anders

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2003-01-12 11:22

Strange, it worked last time I used it...
My version doesn't automatically recurse directories either.
Thought I mentioned that. I think someone did an alternate
version of adddir.pl in the customization forum here that did so.
Try searching the forum on adddir or adddimage to find it.

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Mon, 2003-01-13 06:49

Hmm. It sounds like I may have to stop putting it off and do a revision.

There will still be dependencies.

 
headhunter

Joined: 2003-01-13
Posts: 75
Posted: Mon, 2003-01-13 22:57

Just curious, would it be easier writing up a small program that will just batch an entire directory? I'm looking at the directory structure etc that the gallery program creates. Wouldn't you just need to duplicate the same thing when adding more folders and editing the files that are there?

 
dannyman

Joined: 2003-01-24
Posts: 1
Posted: Fri, 2003-01-24 02:06

Is there a way to coax adddir.pl to create a new album inside an existing sub-album? From there, It would be a simple exercise of adding a wrapper to upload an entire existing folder hierarchy of images into gallery. (Or just hak adddir to call itself on directory entries.) It would appear, however, that gallery wasn't meant to handle subgalleries, originally, and a bad thing could potentially happen were one to attempt to create two directories of the same name?

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Mon, 2003-01-27 20:25