Usage

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

usage: shis.server [-h] [-c] [-s] [-p PORT] [-d DIR] [-w [SEC]] [-n ITEMS]
                   [-g ITEMS] [-o ORDER] [--thumb-dir DIR] [--previews]
                   [--ncpus CPUS] [--thumb-size SIZE] [--preview-size SIZE]

Named Arguments

-c, --clean

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.

-s, --selection

enable selection mode on the website

This option lets you select images on the website and copy file names of selected images so you can later use them to sort/filter images on the device according to your convenience.

-p, --port

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 7447 is not available, SHIS will try to use the next available port (7448, 7449 and so on).

-d, --image-dir

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.
-w, --watch

filesystem watch interval in seconds (default: False)

SHIS can watch the filesystem for changes and keep the website up to date by automatically creating thumbnails for newer files and deleting them for old ones. This option specifies the time interval (in seconds) to wait before scanning the filesystem for changes. This ability to continuously monitor the filesystem is disabled by default.

-n, --pagination

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.

-g, --group

number of items to group together (default: None)

SHIS can insert newlines at specified intevals so that images appear to be organised in groups, which can be helpful as a visual aid. The ability to group images is disabled by default.

-o, --order

Possible choices: original, random, name

image listing order: name (default), random, or 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.

--thumb-dir

directory to store generated website (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
│   ..
├── 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.

--previews

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.

--ncpus

number of workers to spawn (default: all 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.

--thumb-size

size of generated thumbnails in pixels (default: 256)

This is the size of the thumbnails generated by SHIS. Since SHIS preserves aspect ratios, this represents the length of the smaller dimension. The larger dimension is scaled accordingly. 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.