Jump to content

Module:ImageRatio/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Adam Cuerden (talk | contribs) at 10:26, 31 January 2024 (Created page with '{{Module rating| release}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> == Usage == <code><nowiki>{{</nowiki>#invoke:{{subst:BASEPAGENAME}}|ratio|Filename.jpg<nowiki>}}</nowiki></code> This returns the ratio of width to height (w/h) for an image. Defaults to returning 1, if the image doesn't exist, this avoids divide by 0 errors in templates that use it. <includeonly>{{Sandbox other|| <!-- Categories belo...'). 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)


Usage

{{#invoke:ImageRatio|ratio|Filename.jpg}}

This returns the ratio of width to height (w/h) for an image. Defaults to returning 1, if the image doesn't exist, this avoids divide by 0 errors in templates that use it.