Difference between revisions of "Template:ScaleImage"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 23: Line 23:
 
</pre>
 
</pre>
  
</noinclude><includeonly>[[Image:{{{imagename}}}|{{ #if:{{#pos:{{{newwidth|100}}}|px}}|{{{newwidth|100}}}| {{#expr: ({{#imgw: {{{imagename}}} }} * {{{newwidth|100}}}) / 100 }}px }}|{{{caption|}}}]]</includeonly>
+
</noinclude><includeonly>[[Image:{{{imagename}}}|{{#if:{{#pos:{{{newwidth|100}}}|px}}|{{{newwidth|100}}}|{{#expr:({{#imgw:{{{imagename}}}}}*{{{newwidth|100}}})/100}}px}}|{{{caption|}}}]]</includeonly>
 +
{{#imgw:{{{imagename}}}}}

Revision as of 17:06, 31 May 2020

This template is useful for scaling the given image by percentage or, as usual, by absolute size.

E.g. Scaling the image to 15%:

{{ScaleImage
|imagename=eland.png
|caption=Città di Eland
|newwidth=15
|alignment=center
}}

E.g. Scaling the image to 80 pixel:

{{ScaleImage
|imagename=eland.png
|caption=Città di Eland
|newwidth=80px
|alignment=center
}}


0