Difference between revisions of "W2h"

From Sega Retro

Line 1: Line 1:
<includeonly>{{#expr: ({{#mediaheight:{{{1}}}}}*({{{2}}} div {{#mediawidth:{{{1}}}}})) round 0 }}</includeonly><noinclude>
+
<includeonly>{{#expr: floor({{#mediaheight:{{{1}}}}}*({{{2}}} div {{#mediawidth:{{{1}}}}})) }}</includeonly><noinclude>
 
This template obtains the height of a resized image, given that its width is known.
 
This template obtains the height of a resized image, given that its width is known.
  
Line 9: Line 9:
 
<tt><nowiki>{{w2h|GoldenAxe Title.png|97}}</nowiki></tt> returns '''{{w2h|GoldenAxe Title.png|97}}'''
 
<tt><nowiki>{{w2h|GoldenAxe Title.png|97}}</nowiki></tt> returns '''{{w2h|GoldenAxe Title.png|97}}'''
  
[[Category:Sega Retro templates|{{PAGENAME}}]]</noinclude>
+
[[Category:Sega Retro templates]]</noinclude>

Revision as of 17:46, 23 June 2018

This template obtains the height of a resized image, given that its width is known.

Example

{{w2h|GoldenAxe Title.png|320}} returns 224

{{w2h|GoldenAxe Title.png|160}} returns 112

{{w2h|GoldenAxe Title.png|97}} returns 67