Template:Clean image/doc: Difference between revisions

no edit summary
(Created page with "{{Documentation}} Cleans and formats an input image. This removes the following things if present: * <code><nowiki>[[File:</nowiki></code> * <code><nowiki>]]</nowiki></code> * <code><nowiki>|</nowiki></code> and <code><nowiki>{{!}}</nowiki></code>, 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 <code>frameless</code> modifier is used, which prevents the image...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 17:
 
===Examples===
To be practical the results will be as if <code><nowiki>|image=[[File:Basic baconBucket.png|100px|link=abyssal whip]]</nowiki></code> as the input.
 
{| class="wikitable"
Line 28:
| Just clean
| <pre>{{clean image|file={{{image}}}}}</pre>
| {{clean image|file=[[File:Basic baconBucket.png|100px|link=abyssal whippirate]]}}
| Should result in
<pre>[[File:{FILENAME}]]</pre>
Line 35:
| Clean + width
| <pre>{{clean image|file={{{image}}}|width=50}}</pre>
| {{clean image|file=[[File:Basic baconBucket.png|100px|link=abyssal whippirate]]|width=50}}
| 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:Basic baconBucket.png|100px|link=abyssal whippirate]]|height=20}}
| 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:Basic baconBucket.png|100px|link=abyssal whippirate]]|width=44|height=20}}
{{clean image|file=[[File:Basic baconBucket.png|100px|link=abyssal whippirate]]|width=11|height=50}}
{{clean image|file=[[File:Basic baconBucket.png|100px|link=abyssal whippirate]]|width=66|height=60}}</poem>
| 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.
 
Basic baconBucket.png is 22px wide and 30px tall. In the first use it is trying to resize to twice as wide but the maximum height of 20px forces it to resize down to 15x20px. The second use it successfully resizes down to half as wide, 11x15px. The third use is trying to go thrice as wide but the height limit only allows it to go twice as tall, so is 44x60px.
|-
| Clean + link
| <pre>{{clean image|file={{{image}}}|link=Weird gloopSturlet}}</pre>
| {{clean image|file=[[File:Basic baconBucket.png|100px|link=abyssal whippirate]]|link=Weird gloopSturlet}}
| 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:Basic baconBucket.png|100px|link=abyssal whippirate]]|link=no}}
| Should result in
<pre>[[File:{FILENAME}|link=]]</pre>
Line 73:
| Clean + alignment
| <pre>{{clean image|file={{{image}}}|align=right}}</pre>
| {{clean image|file=[[File:Basic baconBucket.png]]|align=right}}
| Should result in
<pre>[[File:{FILENAME}|align=right]]</pre>