How to automatically post a bunch of photos in your webpage?

You can use the scripts makethumbs.sh and rotate.sh provided by http://www.molenda.com/makethumbs/. The basic procedure is given below.

 

STEP 1.

Download makethumbs.sh and rotate.sh to a directory, ~/mytools say, from http://www.molenda.com/makethumbs/.

STEP 2.

Change the modes of the files makethumbs.sh and rotate.sh by typing command:

    chmod +x ~/mytools/*.sh

STEP 3.

Create a directory, ~/myphoto say. And copy all your jpg files in this directory. This directory only contains the photos you want to post.

STEP 4.

Run the following command in the directory ~/myphoto:

    ~/mytools/makethumbs.sh

STEP 5.

Make a hyperlink to ~/myphoto/index.html.

That's simple!

Notes:

  • If you want to change the title of the photo webpage, captions and descriptions of the photos, you can modify the file ~/myphoto/description.txt and re-type the command ~/mytools/makethumbs.sh.
  • If you want to rotate some photos, use the script rotate.sh. For example, the command

        cp photo1.jpg photo1.jpg.bak
        cp photo2.jpg photo2.jpg.bak
        ~/mytools/rotate.sh r photo1 photo2
        ~/mytools/makethumbs.sh
    

    will rotate photo1.jpg and photo2.jpg anti-clockwise 90 degree. Since rotate.sh may modify the original file, it's better to make a backup for the file you want to rotate. You can type

        rotate.sh --help
    

    to obtain the usage of the script rotate.sh. The following is the copy of the usage information:

    bash-2.04$ ./rotate.sh --help
    Usage: rotate.sh [-p|-o] <-r|-l> file1.jpg file2.jpg file3.jpg ...
     -p | --preserve     Do not touch original image, even if we can do so safely.
     -r | --rotate-right Rotate images to the right (90 deg clockwise)
     -l | --rotate-left  Rotate images to the left (90 deg counter clockwise)
    
        rotate.sh tries to rotate images losslessly if possible.
        Lossless rotation is possible on this system, so it is the default.
        You can override this behavior with -o (overwrite) or with -p (preserve)
    
        Filenames can be any unique part of the filename.  e.g. if DSCN0532.jpg
        exists, 'rotate.sh r 32' will rotate it 90 degrees clockwise.
    
        You can find the latest version of this program at http://www.molenda.com/
        This is version v1.22 of rotate.sh.
    
  • Each time you make some changes (e.g. adding new photos, modifying the descriptions, or rotating photos), you have to re-run the command ~/mytools/makethumbs.sh.
FAQ Category