Jump to content

ជំនួយ:Files

Pp-semi
ពីវិគីភីឌា

ផ្លូវកាត់:
H:IOUF

Uploading files

[កែប្រែ]

Typically the first step in using an image or other media file is to upload it to Wikimedia Commons. For legal reasons, some files must be uploaded to the English Wikipedia instead. វិគីភីឌា:Upload helps you to choose between these options.

Many media files are copyrighted without permission to redistribute, and cannot be uploaded to either location. See វិគីភីឌា:Image use policy for details about which media files can be uploaded. If a file of the same name exists on both Wikipedia and Wikimedia Commons, the Wikipedia file will be displayed.

The preferred image formats are SVG, PNG, JPEG, and XCF. The preferred sound formats are Ogg (using FLAC, Speex, and Vorbis codecs) and MIDI. Videos must be Ogg files using the Theora video codec.

Bear in mind that media files can contain hidden data, such as comments that are not displayed, Exif metadata, and messages hidden via steganography.

Choose a good name for the media file before you upload it, as you will not be able to rename it yourself later. Once the file is uploaded you should be able to read and make sense of its file page, which describes the file and lets the reader see the image in its original size.

Be aware that the size of the image may affect the page performance. As a rule, files uploaded for use on wikipedia should be the smallest size possible that does not sacrifice clarity in the image. Note also that animated gifs that are too large will not animate, but display the first frame as a static picture. See this link for details.

Using files

[កែប្រែ]

Once you have uploaded a file, you can use it in a Wikipedia article by editing the page to contain text that looks like this, with the result shown just below it and to the right:

[[File:Wikipedesketch.png|thumb|alt=A cartoon centipede reads books and types on a laptop.|The Wikipede edits ''[[Myriapoda]]''.]]
A cartoon centipede reads books and types on a laptop.
The Wikipede edits Myriapoda.

(Although the above text may appear in multiple lines for formatting purposes, the actual text should be on one line.) The above text contains the image file name "Image:Wikipedesketch.png", the alt text "A cartoon centipede reads books and types on a laptop.", and the caption "The Wikipede edits Myriapoda." Alt text is intended for visually impaired readers, and should describe the gist of the picture's appearance. The caption is intended for all readers and explains the picture's meaning. Alt text and captions typically have little text in common.

A reader of the article can click on the thumbnail, or on the small double-rectangle icon below it, to see the corresponding image page. The image normally floats to the right as illustrated here.

The extended image syntax provides many options to control how an image is displayed. You can make it float to the left, center it, and place it without text flowing around it. You can change its size and let the reader move around in a panorama. You can avoid image stackups in several ways, for example, by alternating left and right images, by aligning images, and if all else fails by forcing a break. You can create a gallery of images arranged into an array by using table syntax, by using a template such as {{Image gallery}}, and by using a gallery tag (unfortunately, gallery tags do not support alt text, so they generate galleries that are not accessible to readers who cannot see the images). Also, you can create plain pictures that do not have captions and can be mingled with text and other images; these can use more fine-grained techniques, including borders, vertical alignment with text, and control over links. You can also link to an image without displaying it.


This page explains the image syntax when editing the wiki. Before using images in your page, your wiki must have file uploads enabled (see the ទំព័រគំរូ:Mediawiki for details) and you have to upload a file.

style="background:#8DA7D6; color:black;" Description style="background:#8DA7D6; color:black;" You type style="background:#8DA7D6; color:black;" You get
Embed image
(with alt text)

[[Image:Example.jpg|Sunflowers]]

Sunflowers

Link to description page

[[:Image:Example.jpg]]
[[:Image:Example.jpg|Sunflowers]]

Image:Example.jpg
Sunflowers

Link directly to file

[[Media:Example.jpg]]
[[Media:Example.jpg|Sunflowers]]

Media:Example.jpg
Sunflowers

Thumbnail
(centered, 100 pixels
wide, with caption)

[[Image:Example.jpg|center|thumb|100px|Sunflowers]]

Sunflowers
Border
(100 pixels)
Results in a very small gray border

[[Image:Example-white-bg.jpg|border|100px]]

Frameless
Like thumbnail, respect user preferences for image width but without border and no right float.

[[Image:Example.jpg|frameless]]

The full syntax for displaying an image is:

[[Image:{name}|{options}]]

Where options can be zero or more of the following, separated by pipes:

  • thumb, thumbnail, frame, or frameless: Controls how the image is formatted
  • left, right, center, none: Controls the alignment of the image on the page
  • baseline, sub, super, top, text-top, middle, bottom, text-bottom: Controls the vertical alignment of the image on the page
  • {width}px: Resizes the image to the given width in pixels
  • Special cases:
    • page=1: Displays the specified page when showing a djvu file
  • link={destination}: Allows to link to an arbitrary title, URL or just nowhere (1.14+)
  • alt={alternative text}: For changing the alternative text (alt="") of an image (1.14+)

The options can be given in any order. If a given option does not match any of the other possibilities, it is assumed to be the caption text. Caption text can contain wiki links or other formatting.

The following table shows the effect of all available frame types.

ជំនួយ:Files/frameជំនួយ:Files/frameជំនួយ:Files/frameជំនួយ:Files/frame
style="background:#8DA7D6; color:black;" You type style="background:#8DA7D6; color:black;" You get

Size and Frame

[កែប្រែ]

Among different frame type, the effect of the size parameter may be different, as shown below.

ជំនួយ:Files/sizeជំនួយ:Files/sizeជំនួយ:Files/sizeជំនួយ:Files/size
style="background:#8DA7D6; color:black;" Frame style="background:#8DA7D6; color:black;"
colspan=3|You get

Border and Frame

[កែប្រែ]
ជំនួយ:Files/borderជំនួយ:Files/borderជំនួយ:Files/borderជំនួយ:Files/border
style="background:#8DA7D6; color:black;" Frame style="background:#8DA7D6; color:black;"
colspan=2|You get

[[Image:Wiki.png|50px]] (no alignment specified, or default alignment) text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

[[Image:Wiki.png|50px|none]] (specify alignment as none) none none none none none none none none none none

none none none none none none none none none none

[[Image:Wiki.png|50px|center]] center center center center center center center

center center center center center center center

[[Image:Wiki.png|50px|left]] left left left left left left left left left left

left left left left left left left left left left left left left left left left left left left left

[[Image:Wiki.png|50px|right]] right right right right right right right right

right right right right right right right right right right right right right right right right right right

Other files

[កែប្រែ]

You can link to an external file using the same syntax used for linking to an external web page.

  • [http://url.for/some/image.png]

Or with different text:

  • [http://url.for/some/image.png link text here]

If it is enabled on your wiki (see ទំព័រគំរូ:Mediawiki), you can also embed external images. To do that, simply insert the image's url:

  • http://url.for/some/image.png
[កែប្រែ]

It's easy to make a gallery of thumbnails only, not other images, with the <gallery> tag. The syntax is:

<gallery>
Image:{filename}|{caption}
Image:{filename}|{caption}
{...}
</gallery>

Note that the image code is not enclosed in brackets when enclosed in gallery tags.
Captions are optional, and may contain wiki links or other formatting.

for example:

<gallery>
Image:Example.jpg|Item 1
Image:Example.jpg|a link to [[Help:Contents]]
Image:Example.jpg
Image:Example.jpg
Image:Example.jpg|''italic caption''
Image:Example.jpg|on page "{{PAGENAME}}"
</gallery>

is formatted as:

Parameters

[កែប្រែ]

The gallery tag itself takes several additional parameters:

<gallery {parameters}> {images} </gallery>
  • caption={caption}: sets a caption on the gallery.
  • widths={width}px: sets the widths of the images.
  • heights={heights}px: sets the (max) heights of the images.
  • perrow={integer}: sets the number of images per row.
[កែប្រែ]