Announce: galleryscr.pl 1.00

iainlea

Joined: 2004-09-24
Posts: 10
Posted: Thu, 2005-03-24 15:29

A perl script to output images from a gallery or local directory structure.

Background:
I wanted to have the screensaver on my windows and unix systems use the images from my Gallery. After trying to install the windows gallery screensaver available in the tools/utilities section of the gallery website I ended up writing this. Simply setup your screensaver to read the images from a directory and have this run with '... -m 2 -f 2 ...' and you will be all set for a random new image to be written to gallery.jpg every 15 seconds.

You can download it here: http://iainlea.dyndns.org/software/galleryscr/

Usage: galleryscr.pl [options] [file(s) | dir(s)]
       -a album  album from which to download images (default: all)
       -d dir    directory of local gallery containing images
       -e text   exclude directories and/or images matching pattern
       -f mode   1=as-is 2=gallery.ext 3=gal%05d.ext (default: 1)
       -g url    URL of gallery (default: http://gallery.yoursite.com)
       -i text   include directories and/or images matching pattern
       -l        list available albums for specified gallery
       -m mode   1=sequential  2=random  3=collage (TBI) (default: 1)
       -o dir    output images to this directory (default: .)
       -p pass   password to use to login to gallery
       -q        quiet mode (unless errors are encountered)
       -s secs   seconds to sleep before fetching next image (default: 15)
       -u user   username to use to login to gallery (default: admin)
       -h        help
       -v        verbose

Examples:
  galleryscr.pl -g http://gallery -p secret123 -m 2 -f 2 -s 30

    download images in random order every 30 secs to gallery.ext
(screensaver)

  galleryscr.pl -g http://gallery -u admin -p secret123 -a mycars

    download images in sequential mode from album cars

  galleryscr.pl -d /www/gallery -m 2 -e ".*" -i "kawazaki"

    copy .*kawazaki.* images from /www/gallery directory in random mode

Note: $GALLERY_[DIR|URL|USER|PASS|ALBUM|LOG] variables settable as defaults

Changelog:

- initial release

Here is an example run that downloads random images to a single file:

$ galleryscr.pl -g gallery.mysite.com -u admin -p mypass -m 2 -f -a

System  gallery.nbg.bricbrac.de
Login:  admin  [OK]
Album:  fetching list  [OK]
Check:  kids  [OK]
Check:  xmas2003  [OK]
Check:  xmas2004  [OK]
Album:  kids - fetching images  [OK]
Album:  xmas2003 - fetching images  [OK]
Album:  xmas2004 - fetching images  [OK]
ImageAdd  http://gallery.mysite.com/albums/kids/pic1.jpg  [OK]
ImageAdd  http://gallery.mysite.com/albums/kids/pic1.sized.jpg  [IGNORED]
ImageAdd  http://gallery.mysite.com/albums/kids/pic1.thumb.jpg  [IGNORED]
ImageAdd  http://gallery.mysite.com/albums/xmas2003/tree.jpg  [OK]
ImageAdd  http://gallery.mysite.com/albums/xmas2003/tree.sized.jpg  [IGNORED]
ImageAdd  http://gallery.mysite.com/albums/xmas2003/tree.thumb.jpg [IGNORED]
...
ImageSrc  http://gallery.mysite.com/albums/xmas2004/joe.jpg  [OK]
ImageDst  ./gallery.jpg  [OK]
Sleeping  5
ImageSrc  http://gallery.mysite.com/albums/xmas2003/mick.jpg  [OK]
ImageDst  ./gallery.jpg  [OK]
Sleeping  5
ImageSrc  http://gallery.mysite.com/albums/kids/lucy.jpg  [OK]
ImageDst  ./gallery.jpg  [OK]
Sleeping  5
...
   

Enjoy. Feedback and any patches welcome.

Iain