Usage

SHIS provides a number of options that can help you with customizatiion.

usage: shis.server [-h] [--image-dir DIR] [--thumb-dir DIR] [--port PORT]
                   [--pagination ITEMS] [--order ORDER] [--ncpus CPUS] [--clean]
                   [--previews] [--thumb-size SIZE] [--preview-size SIZE]

Named Arguments

--image-dir, -d

directory to scan for images (default: current dir)

SHIS will recursively scan this directory and all its subdirectories for image files.

Note

SHIS categorizes a file as an image if the file ends in one of the following extensions:
jpeg, jpg, png, or tiff.
--thumb-dir, -s

directory to store generated content (default: “shis”)

SHIS will store all processed files in this directory, the structure of which is as follows:

shis
├── small
│   ├── image.jpg
│   ..
├── large
│   ..
├── full
│   ├── image.jpg -> ../../image.jpg
│   ..
├── static
│   ├── dir-subdir.html
│   ..
├── html
│   ├── dir-subdir.html
│   ..
└── index.html

Once processing is complete, small shall store small size thumbnails (default: 320px) of every image. If --previews is set, large shall store large size previews (default: 1024px) of every image. If not, then it shall store symlinks to the original image in image_dir. full shall always store symlinks to the original image in image_dir.

The static folder stores Javascript and CSS files required for the website. index.html is the first HTML page of the website. All other HTML pages are stored in html.

--port, -p

port to host the server on (default: 7447)

This is the port on which the generated website shall be served. By default, this is set to 7447 (the T9 keys for shis). If you ever encounter OSError: [Errno 98] Address already in use while running SHIS, this is the option that you should change.

--pagination, -n

number of items to display per page (default: 200)

This is the maximum number of thumbnails displayed in a single page on the website. The rest of the images are distributed across multiple pages.

--order, -o

Possible choices: original, random, name

image listing order: name (default), random, original

This is the order in which images shall be displayed. You can either choose to sort images by their filename, shuffle them in random order, or choose to leave the order untouched.

--ncpus, -j

number of workers to spawn (default: available CPUs)

This is the number of processes that will be spawned simultaneously. One of these processes will be used to run an HTTP Server and the others will be used parallely for the purpose of processing images. By default, SHIS is configured to use all available CPU cores for maximum performance.

--clean, -c

remove existing –thumb-dir (if any) before processing

If thumb_dir already exists, SHIS does not attempt to remove any existing thumbnails from the small, large, or full directories. In fact, SHIS uses this information to only create thumbnails if they haven’t already been created. However, if this option is set, SHIS will clear all contents from thumb_dir and start afresh.

--previews, -f

also generate fullscreen previews (takes more time)

When a user clicks on a thumbnail in the generated website, a full screen preview opens up. By default, this is the original full size image being served. If this option is set, SHIS will explicitly create thumbnails for full screen previews (which will typically be much smaller in size compared to the original full size image) and serve them instead of the original full size image.

--thumb-size

size of generated thumbnails in pixels (default: 256)

This is the size of the thumbnails generated by SHIS. Note that this option also controls the size of the thumbnails displayed on the website.

--preview-size

size of generated previews in pixels (default: 1024)

This is the size of the full screen preview generated by SHIS. Note that the website always displays fullscreen previews.