Difference between revisions of "Template:ScaleImage"

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

Revision as of 16:54, 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
}}