Jump to content

Module:Sandbox/Imagesize/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RexxS (talk | contribs) at 20:49, 31 March 2019 (creating documentation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This module is adapted from the 'getdimensions' function in Module:Multiple image for use as a stand-alone.

It has three functions: getWidth, getHeight, getDimensions. They take a filename, with or without the "File:" prefix, and return the width, or the height, or both dimensions (WIDTHxHEIGHT), respectively. It works with files on Commons or local ones, and works with animated gifs using the dimensions of the first image.

Examples

  • {{#invoke:Sandbox/Imagesize|getDimensions|Example.jpg}} → 300x300
  • {{#invoke:Sandbox/Imagesize|getWidth|Example.jpg}} → 300
  • {{#invoke:Sandbox/Imagesize|getHeight|Example.jpg}} → 300
  • {{#invoke:Sandbox/Imagesize|getDimensions|File:Bishzilla Lucia Looking Right.gif}} → 100x103