FANDOM


DynamicImages allows scaling up of small SVG images when needed, and allows increasing their source dimensions, for preventing common gaps between paths.

Effects

The tool affects the following cases of SVG images on a page:

  • Gallery images- in case the image is smaller than its thumb container, it would be scaled up.
  • Lightbox modal images- similar to SVGs in galleries, this will also dectect if the image is smaller than its available space, and scale it up if needed.
  • SVG images in general- to prevent gaps between paths in the images, this allows increasing images' source, to reduce any gaps.

Note that this feature will not work with images added using their full URL.

Installation

Settings

You can decide whether or not to make the feature affect certain parts by adding to the JS page from which it's imported the following lines:

Remember! If using settings, add these lines before the script that imports DynamicImages
window.dev = window.dev || {};
window.dev.DynamicImages = {
	svgGallery: true,
	svgLightbox: true,
	svgIncreaseSrc: 1
}

The configuration example above shows the default settings. The table below lists the role of each one of the properties and its valid values.

Property Role Valid values Default value
svgGallery Whether or not to make it affect wiki galleries (small SVG) A boolean (true to enable or false to disable) true
svgLightbox Whether or not to make the image-preview lightbox (small SVG)
svgIncreaseSrc Increasing the dimensions of the SVG source (multiplies the original size by this value). This prevents gap creation between nearby paths on the PNG thumb Any positive number (doesn't have to be an integer). The higher the number is, the smaller the gap would be, but will result in a longer loading time for each image 1

Versions

  • July 5, 2015- updating script to match the new lightboxes URL.
  • March 15, 2015- fixing increased source for SVG images. Removing GIF images' support per FANDOM's updated image system, which covers animations, and changing the global object and its properties.
  • November 19, 2014- increased src dimensions for SVG images.
  • November 8, 2014- lightbox SVG images are only scaled up once their enlarged version has loaded.
  • July 25, 2014- files with no file type (e.g. videos). Also fixing problems with SVG matches in galleries.
  • July 24, 2014- fixing bug where thumb images were treated as gallery images.
  • April 23, 2014- fitting lightbox to SVG images in galleries correctly.
  • April 5, 2014- adding an optional lightbox resizing for SVG files.
  • March 16, 2014- updating correctly archived GIF files.
  • February 25, 2014- clean up for gallery images code.
  • February 12, 2014- fixing occasional loading bugs.
  • December 17, 2013- including gallery SVG images to the script, adding missing default settings.
  • December 15, 2013- DynamicImages is released.