Design for intelligent regeneration rules


General: 

1. Store in the root album in a .not_image file all the parameters
   that have been used globally to generate this album. When this file
   is not present, then it will be generated the first time an
   intelligent generation is requested (this is done to allow
   migration to the new generation technique without being forced to
   regenerate everything).

   First there are the parameters that require a forced global 
   regeneration, when they are changed (conditioned on whether 
   they a really different (see below))

   - all the thumbnail and medium-sized options 

   We also have the options that require unforced global regeneration:

   - all album options (except the cleanup option)

2. Now, when a manual generation is started, it will put the
   additional settings in the file (or replace in case of a global
   generation). 

3. When an intelligent regeneration is required, we check whether the
   things have possibly changed and then try to determine the
   directory that contains all changed dirs. 

   When changing to "no medium size", do unforced global regeneration 
     with cleanup

   When medium sized picture change (or introduction) and on
     initialization of album: request a check of all medium sized
     pictures in tn and mark all directories with medium sized
     pictures that have a different size.

   When changing thumbnail size and on initialization: Check for each
     image whether the thumbnail size is met, if not mark the directory

   When change to no cropping is requested and on initialization,
      each directory that contains a thumbnail with the maximal size
      is suspectible (which probably makes all directories
      suspectible.

   When change to cropping is requested and on initialization, all
      directories containing thumbnails with thubnails not using the
      maximal size are suspectible.

4. Check the tree for directories that need (unforced) regeneration
   and determine the dir that contains all

   - captions, header, or footer more recent than index.html 
   - image file more recent than medium sized, thumbnail, or html page
     (or they are missing)
   - if index.html is missing, regenerate immediate super album
   - if index.html is significantly more recent than index file
     in super album, regen suber album
 
5. If dir for forced is missing -> only unforced
   If dir for forced contains unforced -> only forced
   if dir for unforced does contain the forced dir and is much bigger
   or they are unrelated, offer two runs, otherwise use the bigger and
   do a forced regen

   Simpler startegy: Choose lowest dir containing all. Choose
   strongest operation.

7. Ask user for confirmation.

-----------------------------------------------------------------

Note: For files, we have to use mtime, but for directories we should
use ctime (change of inode). 
