Home
Random
Log in
Settings
About Brighter Shores Wiki
Disclaimers
Search
Editing
Template:Clean image/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{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 being resized larger than its actual dimensions. ==Usage== <pre>{{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 }}</pre> ===Examples=== To be practical the results will be as if <code><nowiki>|image=[[File:Bucket.png|100px|link=abyssal whip]]</nowiki></code> as the input. {| class="wikitable" ! Example ! Code ! Result ! Notes | |- | Just clean | <pre>{{clean image|file={{{image}}}}}</pre> | {{clean image|file=[[File:Bucket.png|100px|link=pirate]]}} | Should result in <pre>[[File:{FILENAME}]]</pre> Note that it links to the file page as a normal image does. |- | Clean + width | <pre>{{clean image|file={{{image}}}|width=50}}</pre> | {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|width=50}} | Should result in <pre>[[File:{FILENAME}|{WIDTH}px]]</pre> |- | Clean + height | <pre>{{clean image|file={{{image}}}|height=20}}</pre> | {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|height=20}} | Should result in <pre>[[File:{FILENAME}|x{HEIGHT}px]]</pre> Remember that height parameters on images are maximum height limits and won't make an image bigger (without a width set). |- | Clean + width + height | <pre>{{clean image|file={{{image}}}|width=44|height=20}} {{clean image|file={{{image}}}|width=11|height=50}} {{clean image|file={{{image}}}|width=66|height=66}}</pre> |<poem>{{clean image|file=[[File:Bucket.png|100px|link=pirate]]|width=44|height=20}} {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|width=11|height=50}} {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|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. Bucket.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=Sturlet}}</pre> | {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|link=Sturlet}} | Should result in <pre>[[File:{FILENAME}|link={LINK}]]</pre> |- | Clean + link suppress | <pre>{{clean image|file={{{image}}}|link=no}}</pre> | {{clean image|file=[[File:Bucket.png|100px|link=pirate]]|link=no}} | Should result in <pre>[[File:{FILENAME}|link=]]</pre> |- | Clean + alignment | <pre>{{clean image|file={{{image}}}|align=right}}</pre> | {{clean image|file=[[File:Bucket.png]]|align=right}} | Should result in <pre>[[File:{FILENAME}|align=right]]</pre> |} <includeonly>[[Category:Formatting templates]]</includeonly>
Summary:
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see
Brighter Shores:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Template:Clean image
(
edit
)
Template:Documentation
(
edit
)
Module:Array
(
edit
)
Module:Clean image
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Paramtest
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
view source
) (semi-protected)