AutoScrapbook-NEW-4.0


Top


NAME

AutoScrapbook-NEW - index images and films (and more) and create a static site

Top


SYNOPSIS

asb [--[no]options...] dir1 [dir2 dir3 ... dirN]

The following options can be used preceded by two dashes (e.g. --help), 0/1 options can be used with --no (e.g. --nobig), the default values are given here.

 'askdirreproc' => 0    # ask (1) or not (0) before reprocessing a dir
 'author' => 'Firsty Second'    # Your Name
 'autorotate' => 0 # try to rotate correctly images and films (EXIF based)
 'backup' => 1  # should the original of a file be saved or not
 'big' => 1     # copy full-sized picture (1/0)
 'comment' => 1 # don't force existence of comment with --nocomment
 'config' => 'default'  # different configs are possible
 'debug' => 0   # debug ON or OFF (1/0)
 'delorig' => 0 # when deleting a file, should we delete the original
 'display' => 1 # display or not image while modifying it
 'email' => 'example@example.net'       # Your Email
 'exif' => 1    # do we want or not a column with exif information
 'exif-thumbs' => 1     # do we use thumbfile in EXIF information?
 'force-change' => 0    # force change (same effect as "touch $0").
 'fps' => '24'  # wished frames per seconds of film
 'help' => 0    # get help
 'medium-geometry' => '800x800' # geometry of medium size image
 'modify' => 1  # make modification of original picture possible (1/0)
 'newdirproc' => 'ask'  # process new dirs (yes, no or ask)
 'oldmm' => 0   # use old version of MPlayer and MjpegTools
 'parent' => 1  # should index.html reference back to parent directory?
 'medium-cutoff' => '200',      # max. size in KB to create medium image
 'skip' => 1    # if unset (--noskip), ignore the skip flag.
 'target' => '' # if images and webpages should be copied elsewhere
 'thumb-geometry' => '100x100'  # geometry of thumbnails
 'tvnorm' => '+p'       # TV Norm to use (+p for PAL, +n for NTSC)

Top


DESCRIPTION

AutoScrapbook-NEW (short asb) scans directories, looking for images (mostly JPEG but also other types) and films (in MJPEG format). The user can then comment, modify, skip or delete these files. Out of the information gathered, plus EXIF information if available, asb then creates static web pages, with thumbnail overviews, and sub-directories.

Basically, each directory given on the command line is scanned, the user is asked for a name and a description. Then for each file found, the user can give a comment as well, modify the file (depending on the type of the file, things like rotate, edit), delete it or skip it (the file is then ignored). Afterwards, asb creates a thumbnail image for each file and, if the original file is ``too big'', a medium sized file:

Out of all this information, one webpage index.html is created in each sub-directory, and, per default, linked together.

Top


OPTIONS

--[no]askdirreproc ask for directory reprocessing
When a new directory is discovered by asb, the user is asked if he wants to process it. If the answer is positive, the user is not asked anymore in successive runs. This flag allows to change this.

--author=STRING name of the author
Just give your name, like --author='First Last'. This information will be used for the creation of the webpages. See also the email option.

--[no]autorotate try to rotate correctly images and films
Based on EXIF information, it is possible to place images (and films) in the correct direction. This options allows you to do it automatically.

--[no]backup backup original file
Main aim of the program for me was to process photos and films created with my digital camera, without risking to loose the original. Therefore the program saves per default the unmodified version of each file (this does not mean that each version is backuped, but only the first one). Each modified file is saved once in the hidden directory .orig in each sub-directory. Using --nobackup, the original version is not saved.

--[no]big use full-size picture
Per default the original file, which might be very big is linked into the webpage, respectively copied when using the target option. By using --nobig, the original file is neither copied nor linked, as long as a medium sized file exists; this is very handy for websites.

--[no]comment force use of comment
Per default, every file must have a comment, using --nocomment you remove this obligation (see examples in combination with --nomodify).

--config=STRING configuration name
It is possible to save different configuration (i.e. which files are skipped, order, comments...). The configuration name can only contain small caps letters, the default is... 'default'.

--[no]debug debug mode
Yep, with this one, you can have a lot of debug messages.

--[no]delorig delete original file
As described for the backup option, per default, the original file is saved before any modification. Per default as well, a backup is made or kept if the file is deleted. Using --delorig, you can completely wipe out files, without any remaining backup. Your choice.

--[no]display display file
Per default, each file is displayed, so that you can see what you are doing. With --nodisplay, nothing is shown, which can spare time (especially if you use a file browser in parallel).

--email=STRING email of the author
Just give your email address, like --email='first@last.org'. This information will be used for the creation of the webpages. See also the author option.

--[no]exif exif information
The table created by asb contains per default a column with all possible EXIF information. With --noexif, this column is suppressed.

--[no]exif-thumbs thumbfiles from the EXIF information
The EXIF information might contain also a thumbnail of the picture. Per default this EXIF-thumbnail is used. If you prefer to have the thumbnails created on the fly, use --noexif-thumb.

--force-change re-process all files
Per default, unmodified files are not re-processed; you can force re-processing of all files with this option. The same effect is obtained when the script asb is modified. This means that the index.html file is recreated.

--fps=INTEGER frames per second
The films of my Canon Ixus v3 have 15fps, which is not an accepted standard for MPEG1 or 2 films, therefore I re-sample them to 24 fps. But if you prefer another rate, you can use this option.

--help get help
Some short reminders...

--medium-geometry=INTEGERxINTEGER geometry of medium sized image
If a medium image needs to be created, it will have maximum this size. The default is 800x800, which means that no dimension will be bigger than 800 (e.g. a file of 1200x1600 will be reduced to 600x800).

--[no]modify modify files
Per default, you can modify files (edit, rotate, delete, skip, etc...). With --nomodify, you can do this only for images that have not yet been commented.

--newdirproc=yes|no|ask process new directories or not
When a new directory is discovered by asb, the user is asked if he wants to process it by default (or set to ask). With this option set to yes, each new directory is processed; set to no, no new directory is processed (only old ones).

--[no]oldmm use old versions of MPlayer and MjpegTools
mm stands for MultiMedia, and means MPlayer and MjpegTools. set --oldmm if you have MPlayer 0.9.2 and mjpegtools 1.6.0 and --nooldmm (the default) if you have MPlayer 1.0pre3 and mjpegtools 1.6.2. For other versions, you'll need to try, but obviously mixing is not possible.

--[no]parent reference to parent directory
Webpages created in sub-directories have per default a reference to the webpage of the parent directory. Using --noparent this reference is removed.

--medium-cutoff=INTEGER minimum size for medium file creation
Medium sized files are only created if the original file is bigger than this size in KB. The default is 200KB.

--[no]skip respect skip decision
During processing of the files, you can decide to skip a certain file, and this decision is normally respected: you won't be asked anymore about this file (as long as you work under the same configuration name, see option config). Using --noskip, you'll see again all the files and can change your decision.

--target=DIRECTORY target directory
By using this option, you can create webpages, medium and thumbnail files in another directory than the original one; without the --nobig option, the original files are also copied to the new directory. Take care that the end-directory is relative; if you call:
        asb --target=/home/user/public_html Images

the end directory will be /home/user/public_html/Images.

--thumb-geometry=INTEGERxINTEGER geometry of thumbfiles
Thumbnail images that are not created out of the EXIF information will have this size. The default is 100x100, which means that no dimension will be bigger than 100 (e.g. a file of 1200x1600 will be reduced to 75x100).

--tvnorm=+p|+n TV Norm
This is the TV Norm your films are. For non-standard films, as created by my Canon Camera, the mjpegtools are not able to guess the standard used. Possible values are +p for PAL (default) and +n for NTSC.

Top


EXAMPLES

The simplest command, in order to process the sub-directory pics in the current directory:

        asb

Process the directory Image without EXIF information:

        asb --noexif Image

A good one to create a Website (the original pictures are not copied, you can put specific comments and skip private pictures you don't want to publish) is:

        asb --config=web --nobig --target=/home/user/public_html Pictures

With the following command, you get a new chance to process formerly skipped files, all index.html files will be recreated, but you will get only the files to modify that do not have yet a comment, everything for the current directory:

        asb --noskip --force-change --nomodify .

And using the --nocomment switch, you can recreate the webpages without being bothered by any question (even if certain files or directories don't have a comment):

        asb --force-change --nomodify --nocomment .

Top


TIPS 'n' TRICKS

Top


DEPENDENCIES

I would recommend to have most of the following commands (together with the variables you might want to modify if your utilities are placed otherwise):

Commands for JPEG images

From a package called jpeg, or libjpeg or libjpeg-progs

        $JPEGTRAN = '/usr/bin/jpegtran';
        $RDJPGCOM = '/usr/bin/rdjpgcom';

For exif manipulation

        $EXIF = '/usr/bin/exif';
        $EXIFTAGS = '/usr/bin/exiftags';
        $JHEAD = '/usr/bin/jhead';

Those commands are slightly less critical than all the other ones. I would still recommend to have jhead and either exif or exiftags.

Commands for all kind of images

From the ImageMagick package

        $MOGRIFY = '/usr/bin/mogrify';
        $IDENTIFY = '/usr/bin/identify';
        $DISPLAY = '/usr/bin/display';
        $CONVERT = '/usr/bin/convert';

Any image editor

        $IMAGEEDITOR='/usr/bin/gimp';

But it can be as well any of your favorite image editor.

Commands for AVI MJPEG files

from the MPlayer package

        $MPLAYER = '/usr/bin/mplayer';
        $MENCODER = '/usr/bin/mencoder';

For the SuSE distribution (and perhaps others), the standard package doesn't fit as it doesn't contain mencoder. Therefore compile yourself your package or use the package from http://packman.links2linux.de

from the mjpegtools package

        $MP2ENC = '/usr/bin/mp2enc';
        $MPEG2ENC = '/usr/bin/mpeg2enc';
        $MPLEX = '/usr/bin/mplex';
        $JPEG2YUV = '/usr/bin/jpeg2yuv';
        $LAVTRANS = '/usr/bin/lavtrans';
        $LAVADDWAV = '/usr/bin/lavaddwav';

For the SuSE distribution (and perhaps others), the standard package doesn't fit as it doesn't contain the encoder. Therefore compile yourself your package or use the package from http://packman.links2linux.de.

The man page of mp2enc recommends to use toolame from http://mikecheng.d2.net.au/ instead, as being of better quality, but I was to lazy to package and test.

Top


VERSION

This is AutoScrapbook-NEW 3.9 (2004-11-28) [beta9 of version 4.0]

Top


AUTHOR

Eric Lavarde <asb@zorglub.s.bawue.de>

Based on AutoScrapbook 3.7 (Jan 23, 2003), program written by Kirk Bauer <kirk@kaybee.org>

Thanks a lot as well to Ben Edgington for his introduction to ``film-making'' under http://www.edginet.org/techie/linux/canon_movies.html.

Top


LICENSE

It is distributed under the MIT license, which basically says that you can do anything you want with this problem (even commercial activities) for free, as long as you give the authors credit for the program.

This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

#####################################################################

Copyright (c) 2003 Kirk Bauer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#####################################################################

For more information, please visit http://linux.kaybee.org/

Top


FILES

In each processed directory, the following directory and files are created:

Top


SEE ALSO

All the commands in the DEPENDENCIES section.

Top


BUGS

Top


TODO

Top


DEVELOPER DOCUMENTATION (sort of)

Function firstOlderThanLast(file1,file2)
Returns true if the first file is strictly older than the second. file1 and/or file2 can also be timestamps (integers in seconds since epoch). If a file doesn't exist, its timestamp is supposed to be 0.

Function backupOrig (dir, \%info)
This function is just meant to save the original file, so that subsequent changes can be rollbacked (especially with multiple lossy changes and JPEG). In other words, a file is only saved once and then no more.

Function SetOrder (directory, items)
function takes care that items are always processed in the same order by saving order in the dir.order file. New items are appended, items not existing anymore are removed. returns the new sorted list of items.

Function GeneratePage(source directory, target directory, list of items)
Function ProcessDir(directory)
generates a list of items in the directory (sub-directories and images) calls itself on sub-directories checks if something changed in itself or sub-directories sorts the items with SetOrder if something changes, calls GeneratePage on the list of items and re-sorts returns: 1 if something changed, -1 in case of error, 0 else.

Release history

  1. 4.0 2004-11-28
  2. Improve default naming of directory. First and Last official release of monolithic AutoScrapBook-NEW, have a look now for ASB (AnotherScrapBook, yet to come).

  3. 3.9beta8 2004-11-13
  4. Added workaround to remove need for patched lavaddwav. Redirected stdin of MPlayer when forking (else MPlayer is catching stdin somehow).

  5. 3.9beta7 2004-08-08
  6. Added option 'newdirproc' to avoid questions on new directories.

  7. 3.9beta6 2004-05-11
  8. Upgraded from MPlayer 0.9.2 to 1.0pre3, and from mjpegtools 1.6.0 to 1.6.2. This required some fixing, which has been made 'non backwards compatible'. Old methods have been kept (option --oldmm, Old MultiMedia).

  9. 3.9beta5 2004-04-18
  10. Corrected problems of files and directories with blanks. Added 'autorotate' functionality. Corrected problem with HTML artefacts in comments for 'alt' attributes. Corrected small problem with TITLE of Dir being '.'. Enhanced handling of legacy structures.

  11. 3.9beta4 2003-12-10
  12. Added possibility to enter shortest possible action with Text::Abbrev. Added function 'which' to find binaries where they really are (one less to configure in the code!). Made the TV Norm to an option (PAL or NTSC, yep, one less to configure). Renamed files get extension from original file if own extension is missing.

  13. 3.9beta3 2003-12-07
  14. Commands in the modify phase can be entered in any caps. Taken care of THM files by adding concept of Auxiliary files ('AUX' and 'aux' Infos). Planned to be first public beta release.

  15. 3.9beta2 2003-11-25
  16. Second beta, with a lot more of user documentation in POD format, some bug fixing, and the new --nocomment option to lift requirement for comments.

  17. 3.9beta1 2003-11-16
  18. First version released by Eric, first beta tester (thanks to Jocki). Main differences to original version 3.7: refactorisation allowing for modularisation of supported files; added support for non-JPEG image files and MJPEG films; added as well quite a lot of options; changed the supporting directory structure; added the possibility to create web-sites at another place than where the pictures are (and without big pictures); etc...

Top

 AutoScrapbook-NEW-4.0