Template:Clean image/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
InvalidCards (talk | contribs) (fix links with bsw stuff instead of rsw) |
No edit summary |
||
Line 17:
===Examples===
To be practical the results will be as if <code><nowiki>|image=[[File:
{| class="wikitable"
Line 28:
| Just clean
| <pre>{{clean image|file={{{image}}}}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}]]</pre>
Line 35:
| Clean + width
| <pre>{{clean image|file={{{image}}}|width=50}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|{WIDTH}px]]</pre>
Line 41:
| Clean + height
| <pre>{{clean image|file={{{image}}}|height=20}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|x{HEIGHT}px]]</pre>
Line 50:
{{clean image|file={{{image}}}|width=11|height=50}}
{{clean image|file={{{image}}}|width=66|height=66}}</pre>
|<poem>{{clean image|file=[[File:
{{clean image|file=[[File:
{{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|{WIDTH}x{HEIGHT}px]]</pre>
Remember that height is still a maximum limit here. The size will be {WIDTH}px wide unless this makes the height more than {HEIGHT}px, in which case it is sized down to {HEIGHT}px tall. Aspect ratio is always kept.
|-
| Clean + link
| <pre>{{clean image|file={{{image}}}|link=Sturlet}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|link={LINK}]]</pre>
Line 67:
| Clean + link suppress
| <pre>{{clean image|file={{{image}}}|link=no}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|link=]]</pre>
Line 73:
| Clean + alignment
| <pre>{{clean image|file={{{image}}}|align=right}}</pre>
| {{clean image|file=[[File:
| Should result in
<pre>[[File:{FILENAME}|align=right]]</pre>
|
Latest revision as of 17:39, 18 November 2024
Template:Clean image invokes function main in Module:Clean image using Lua.
Cleans and formats an input image. This removes the following things if present:
[[File:
]]
|
and{{!}}
, and everything following the first of these until the end
Then it re-packages the image into a new file container, with specified height, width, and link. The frameless
modifier is used, which prevents the image being resized larger than its actual dimensions.
Usage
{{clean image |file = wikitext to be cleaned; this should usually be a template parameter (e.g. |file={{{image}}}); required |width = width of image; no default; exclude 'px' |height = height of image; no default; exclude 'px'; can be combined with width |link = link to apply to image; no default (will link to file page); setting to no will suppress normal link |align = alignment of image; left, center, right; no default }}
Examples
To be practical the results will be as if |image=[[File:Bucket.png|100px|link=abyssal whip]]
as the input.