Actions

Template

Difference between revisions of "H2w"

From Sonic Retro

(Created page with "<includeonly>{{#expr: ({{#mediawidth:{{{1}}}}}*({{{2}}} div {{#mediaheight:{{{1}}}}})) round 0 }}</includeonly><noinclude> This template obtains the width of a resized image,...")
 
(temporary fix to stop pdfs breaking things)
Line 1: Line 1:
<includeonly>{{#expr: ({{#mediawidth:{{{1}}}}}*({{{2}}} div {{#mediaheight:{{{1}}}}})) round 0 }}</includeonly><noinclude>
+
<includeonly>{{#switch:{{fileext|{{{1|}}}}}|pdf={{{2|}}}|{{#expr: ({{#mediawidth:{{{1|}}}}}*({{{2|}}} div {{#mediaheight:{{{1|}}}}})) round 0 }}}}</includeonly><noinclude>
 
This template obtains the width of a resized image, given that its height is known.
 
This template obtains the width of a resized image, given that its height is known.
  
Line 8: Line 8:
  
 
<tt><nowiki>{{h2w|Sonic1 title.png|97}}</nowiki></tt> returns '''{{h2w|Sonic1 title.png|97}}'''
 
<tt><nowiki>{{h2w|Sonic1 title.png|97}}</nowiki></tt> returns '''{{h2w|Sonic1 title.png|97}}'''
 +
 +
<tt><nowiki>{{h2w|VGL2 CD US booklet.pdf|97}}</nowiki></tt> returns '''{{h2w|VGL2 CD US booklet.pdf|97}}'''
  
 
[[Category:Sonic Retro templates]]</noinclude>
 
[[Category:Sonic Retro templates]]</noinclude>

Revision as of 14:32, 25 June 2021

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

Example

{{h2w|Sonic1 title.png|224}} returns 320

{{h2w|Sonic1 title.png|112}} returns 160

{{h2w|Sonic1 title.png|97}} returns 139

{{h2w|VGL2 CD US booklet.pdf|97}} returns 97