/MMM-ImageSlideshow

Displays images one-at-a-time from local folders.

Primary LanguageJavaScriptMIT LicenseMIT

Module: Image Slideshow

The MMM-ImageSlideshow module is designed to display images, one at a time on a fixed interval, from one or many directories. These images can be shown in order or at random, one directory at a time or all at time. The image heights and widths can be fixed, and the images can be made to be shown in grayscale.

Dependencies / Requirements

This module requires no special dependencies. The only requirement is that the image directories you path to are fixed paths accessible to the Magic Mirror instance.

Operation

This module will take in a list of directory paths, one or more, containing image files. The module will display those images in either alphabetical or random order, across either each path one at time or across all the paths at once. Once all the images have been shown, it will loop back and start again.

Extra configurations include setting the amount of time an image is shown for, rendering the images in grayscale, selecting which file extensions are valid, and using a fixed image height and/or width.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-ImageSlideshow',
		position: 'bottom_left',
		config: {
			imagePaths: ['modules/MMM-ImageSlideshow/example1']
		}
	}	
]

Configuration options

The following properties can be configured:

Option Description
imagePaths Array value containing strings. Each string should be a path to a directory where image files can be found.

Example: ['modules/MMM-ImageSlideshow/example1']
This value is REQUIRED
slideshowSpeed Integer value, the length of time to show one image before switching to the next, in milliseconds.

Example: 6000
Default value: 10000
This value is OPTIONAL
delayUntilRestart Integer value, the length of time to restart the slideshow after the last image has been shown, in milliseconds. The module will go blank will waits to restart. This value defaults to zero, meaning no delay until restarting.

Example: 6000
Default value: 0
This value is OPTIONAL
fixedImageWidth Integer value, sets a fixed pixel width for all the images to be shown. If set to 0, the image's actual width is used.

Example: 250
Default value: 0
This value is OPTIONAL
fixedImageHeight Integer value, sets a fixed pixel height for all the images to be shown. If set to 0, the image's actual height is used.

Example: 300
Default value: 0
This value is OPTIONAL
randomizeImageOrder Boolean value, if true will randomize the order of the images, if false will use an alphabetical sorting by filename.

Example: true
Default value: false
This value is OPTIONAL
treatAllPathsAsOne Boolean value, if true will treat all the paths specified in imagePaths as one path. Otherwise, if false, images will only be shown from one path at a time in the order of imagePaths, until all the images in that path are exhausted, before continuing to the next path.

Example: true
Default value: false
This value is OPTIONAL
makeImagesGrayscale Boolean value, if true images will be rendered in grayscale (i.e black and white) instead of color. If false they will be rendered as just they are without change.

Example: true
Default value: false
This value is OPTIONAL
validImageFileExtensions String value, a list of image file extensions, seperated by commas, that should be included. Files found without one of the extensions will be ignored.

Example: 'png,jpg'
Default value: 'bmp,jpg,gif,png'
This value is OPTIONAL