<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FImagesize%2Fdoc</id>
	<title>Module:Sandbox/Imagesize/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FImagesize%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Imagesize/doc&amp;action=history"/>
	<updated>2026-04-09T16:47:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Imagesize/doc&amp;diff=145550&amp;oldid=prev</id>
		<title>imported&gt;RexxS: document getScale function</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Imagesize/doc&amp;diff=145550&amp;oldid=prev"/>
		<updated>2019-03-31T21:59:56Z</updated>

		<summary type="html">&lt;p&gt;document getScale function&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
This module is adapted from the &amp;#039;getdimensions&amp;#039; function in [[Module:Multiple image]] for use as a stand-alone.&lt;br /&gt;
&lt;br /&gt;
It has four public functions: getWidth, getHeight, getDimensions, getScale. They take a filename, with or without the &amp;quot;File:&amp;quot; prefix, and return the width, the height, both dimensions (WIDTHxHEIGHT), or the ratio of width to height (multiplied by a scale factor) respectively. It works with files on Commons or local ones, and works with animated gifs using the dimensions of the first image.&lt;br /&gt;
&lt;br /&gt;
The getScale function takes an additional parameter, {{para|scale}} (default is 1). This can be used to directly scale images to the same height using the {{para|upright}} parameter in image syntax.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getDimensions|Example.jpg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getDimensions|Example.jpg}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getWidth|Example.jpg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getWidth|Example.jpg}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getHeight|Example.jpg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getHeight|Example.jpg}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getScale|Example.jpg|scale=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getScale|Example.jpg|scale=1}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getDimensions|File:Bishzilla Lucia Looking Right.gif}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getDimensions|File:Bishzilla Lucia Looking Right.gif}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getDimensions|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getDimensions|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Sandbox/Imagesize|getScale|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|scale=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:Sandbox/Imagesize|getScale|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|scale=1}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Same height, scale=1&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|thumb|upright={{#invoke:Sandbox/Imagesize|getScale|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|scale=1}}]]&lt;br /&gt;
| [[File:Example.jpg|thumb|upright={{#invoke:Sandbox/Imagesize|getScale|Example.jpg|scale=1}}]]&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Same height, scale=0.5&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|thumb|upright={{#invoke:Sandbox/Imagesize|getScale|File:Doorway from Moutiers-Saint-Jean MET DP255158.jpg|scale=0.5}}]]&lt;br /&gt;
| [[File:Example.jpg|thumb|upright={{#invoke:Sandbox/Imagesize|getScale|Example.jpg|scale=0.5}}]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;RexxS</name></author>
	</entry>
</feed>