Help:Images and other uploaded files

To add an image, the image file has to be uploaded. Also other files can be uploaded, see below. The system uses the term "image" for any uploaded file.

First give the file a suitable name, because renaming during or after uploading is not possible. Make sure that the file name has the proper extension. With the file an image description page will be associated, with a page name consisting of the file name (including extension), prefixed with "File:" (or in general the value of variable     ). Thus the file names are case-sensitive (this applies even for the file name extension) except, in most projects, for the first character.

Although on each projects files can be uploaded, a family of projects may have designated one in particular for this, with sharing of those files enabled. For Wikimedia projects this is Wikicommons (free content only, no "fair use" content), in general this is referred to below as Commons.

To upload a file, go to Commons, log in there, and upload the file using the Upload link.

If you want to replace an existing file, give it the same name, and otherwise a name that does not exist yet. Be careful with replacing or deleting an image on Commons, a complication is that the "Image links" section on the image description page on Commons does not show usage of the image by other projects.

Apart from text, MediaWiki supports the following media inline:
 * images -- preferred formats: PNG, JPEG.

Currently SVG images can be uploaded and linked to, but not be embedded, e.g. (image description page) - see also SVG image support.

There may be a size limit, the largest one on en: is 3.5 megabytes (but please be reasonable).

The most common type of media apart from images is:


 * sound -- preferred format: Ogg Vorbis.

If you want to upload other file types then .jpg or .ogg (like for example .pdf) in newer versions of MediaWiki, you have to modify the file LocalSettings.php accordingly: $wgFileExtensions = array( 'png', 'jpg', 'jpeg', 'ogg','doc','xls','ppt','mp3','sxc','pdf' );

Remarks:


 * Wikimedia specific: see Video policy
 * for reasons of security executable programs are not allowed by default

Images can also be produced by the system from specifications in wikitext:
 * Formulas (e.g. )
 * Timelines, navigational maps, etc. (e.g. )
 * thumbnails of uploaded images (e.g. ]) (saves bandwidth compared with letting the browser do the reduction)

Linking
To link to the file use ":File:" instead of "File:", e.g. File:So.gif (the first colon is not displayed).

Piped links work as usual.

Interwiki link style gives a link to the image description page. For embedding (if possible, see below) and linking to the file itself, use external link style.

If interlanguage links would be applicable, use a colon in front of the language code, e,g. de:Bild:Europa-Pos.png, to avoid the link being put in the margin.

External link syntax is as usual. However, if you want a link to an image proper on a page of a project that allows embedded external images, use a bracketed link syntax and not just the URL, to prevent embedding.

Embedding internal images
"Internal" refers to both the same project and Commons. An image name is assumed to refer to the one in the same project if it exists there, otherwise to one on Commons.

Only images proper can be automatically presented, sound is not automatically played.

To add the uploaded image to an article, write something like

To embed an image, one can use, e.g.  which gives the image on the right. The caption can contain links.

This format allows both size reduction and enlargement. Both the image itself and an icon link to the image description page with the image in its actual size. The link title of the icon is "Enlarge", even in cases where this term does not apply, because it leads from the enlarged image to the one with the actual size.

For more possibilities, see Extended image syntax. Also, the source of existing pages with images are useful as examples.

Image at the left
  puts the image at the left; text that follows floats around it; a second image immediately after the first is put to the right of it, if there is text in between then the second image is at the lower right of the first, under this 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 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 text text text text text text text text text text text text text text text

With   the image is put at the left, and text that follows starts below it.

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 at the right
  puts the image at the right; text that follows floats around it. The situation is not symmetric with the case above: a second image is put at the extreme right again.

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 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 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 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 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 text

Using full width again
Use   , or on projects that have Template:Clear (Meta and en:):

.

Inline images
Inline images cannot have a caption, but they can have an "alt"-attribute, e.g. shown in the hoverbox (in the cases above, for the image it is the same as the caption, and for the enlarge icon it is "Enlarge"). It is the last item of the image code, hence, if there is only the image name with prefix "File:" it gives that; if there is an empty item by ending with a pipe character it gives the name without prefix; otherwise, it gives the image code item that happens to be last, unless a proper text is specified.

The size of the images can be reduced but they can not be enlarged.

text text  text  text

gives: text text  text  text (also note the hoverbox).

See also below.

Embedding external images
External images can not always be embedded, this depends on the settings of the project: it has been disabled on many of the larger Wikipedias, including the English and German, to prevent vandalism and bandwidth theft from other sites, but it is allowed on many other Wikimedia projects, including Meta and the Dutch Wikipedia.

If enabled on this project there is an image here, otherwise just a link to an image: http://en.wikipedia.org/upload/b/bc/Wiki.png

Currently the following public MediaWiki wikis do not allow external images:
 * English Wikipedia

If necessary, download an image of a project and upload a copy into the Commons project, you can then use it on all projects.

The examples in what follows are intended for projects in which embedding is enabled.

If enabled, use unbracketed external link style, i.e. just the URL (of the image itself, not of the image description page), e.g. http:// en.wikipedia.org/upload/d/d1/Tile_Hill_train_550.jpg. The URL can be found by checking with your browser the properties of the image when it is displayed on a webpage.

Conversely, to go to the image description page of an image referred to with external link style, put the URL in the address bar and replace "upload/number/number/ " with "wiki/File:".

For inline images, put the URL, followed by a space, in the text: a http:// meta.wikimedia.org/upload/2/27/Tst.png b gives ahttp://meta.wikimedia.org/upload/2/27/Tst.png b

Without special formatting, inline images are positioned like this:

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 text text text text text text text text text text text text text text text text text text text text text http://en.wikipedia.org/upload/b/bc/Wiki.png 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 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 text

A table may be used to position the image(s) as desired. E.g.

gives

Similarly

Navigational maps
Navigational maps like  have map areas linked to pages. The HTML with tags can not be put in the wikitext. However, EasyTimeline allows the creation of an image and a page embedding that image, with tags for rectangular map areas in the HTML. The title of a link to a non-internal page is only the domain name, e.g. "en.wikipedia.org/..". The length and width of the rectangle can not be controlled, except that it depends on the length of the link lable and its font size. In case of overlap of rectangles one has to look at the hoverbox or statusbar to avoid following the wrong link. In case of much overlap it may not be possible to use all links.

Examples:

Some attempts for other alternatives (note the hover boxes):

Ascii art map, with both the city outline and the label clickable:

x xxx Leiden x

xx xxxx The Hague xxx

xx xxxxx Rotterdam xxxx

When external images can be embedded:

The HTML titles are "w: Leiden", etc., the alt attribute is "Tst.png". Opera shows the title in the hoverbox, and also the URL, IE only shows the alt.

With labels:

See also Maps, Maps' clickability.

Uploading
On most browsers, you will see a "Browse..." button, which will bring up your operating system's standard file open dialog. Choosing a file will fill the name of that file into the text field next to the button. You must also check the box affirming that you are not violating any copyrights by uploading the file. Press the "Upload" button to finish the upload. This may take some time if you have a slow internet connection.

The preferred formats are JPEG for photographic images, PNG for drawings and other iconic images, and OGG for sounds. Please name your files descriptively to avoid confusion.

Please note that as with wiki pages, others may edit or delete your uploads if they think it serves the project, and you may be blocked from uploading if you abuse the system.

When a file is uploaded with the same name as an existing one, the old one is replaced. If that is not the intention one has to check in advance that the same name does not exist yet, because currently the system does not warn against overwriting. For example, click on http://meta.wikipedia.org/wiki/File:A and replace the A in the address bar of the browser with the file name. Alternatively use the search feature in Special:Imagelist.

When a media file is replaced by uploading a new one with the same name (e.g. an image in an article is replaced), this does not show up in the page history of the article, nor in the Related Changes of the article, nor in the revision history of the image description page (unless the description section is also changed). However, it is recorded in the Image History section of the image description page, and it changes Upload log. Therefore, to watch changes in images in an article, it is not sufficient to watch the article itself and the image description pages ("watching" in the sense of putting on the list of "watched pages"), but one should watch the Upload log also.

Special:Imagelist provides the same information as the Upload log, but it uses the user's local time instead of the default time (set to UTC for Wikimedia projects). In addition it gives the file sizes. Further it allows loading of portions and sorting by size in addition to sorting by date, and it has not only links to the image description pages, but also directly to the images.


 * Last 50 uploaded files
 * MediaWiki file usage - technical notes

Uploading non-image files
By default, MediaWiki only allows you to upload certain types of files (extensions gif, jpg, jpeg, ogg and png). This is managed by this order in includes/DefaultSettings.php:
 * $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg' );

If you want to be able to upload other file typs, for instance ZIP files you must add this line to LocalSettings.php:
 * $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'zip');

Caution: do not modify the line in DefaultSettings.php because it will break when updating

Take in account there is a blacklist of file extensions in includes/DefaultSettings.php:


 * $wgFileBlacklist = array(
 * # HTML may contain cookie-stealing JavaScript and web bugs
 * 'html', 'htm',
 * # PHP scripts may execute arbitrary code on the server
 * 'php', 'phtml', 'php3', 'php4', 'phps',
 * # Other types that may be interpreted by some servers
 * 'shtml', 'jhtml', 'pl', 'py',
 * # May contain harmful executables for Windows victims
 * 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' );

More details and examples on embedding internal images into articles
To include the image in a page, use a link in the form or or  for sounds.

Example: Using, the image Canterbury Tales.png is included:



If the wiki is set to another language than English, the name of the "File:" namespace might be changed. For German, for example, it's Bild:Canterbury Tales.png

Alternate Text
By specifying alternate text, you can make the article accessible to the blind, too. You can specify an alternate text after a "|"-sign, e.g., which will look like this:



Layout and resizing
Several options can be set when including an image. Those affect the placing of the image, its size or the way the image will be presented. Those options are specified between the image name and the alternate text:. Available options are:




 * thumbnail, thumb : generates an automatically resized thumbnail image, normally on the right, with the caption text displayed directly underneath. An "enlarge"-icon is added. Example:  Canterbury Tales.png 
 * right : make the image right-aligned, can be used with and without specifying thumb
 * left : same as above, but left aligned.
 * frame : The image will have a frame, regardless of whether it is a thumb, and the caption text will be included as a visible caption.
 * sizepx</tt> : render a thumbnail version of the image that's [size] pixels wide (e.g. '150px'). Height is computed to keep aspect ratio (i.e. the shape of the image).

Vertical bars are used to separate options from each other and from the caption text. Unknown options are skipped and the last option is used as the caption text.

The options can be combined, e.g. as (shown on the left).

Demo
Below one can see the result of the three types of internal link style and external link style on this project. To test this in another project, copy the wikitext there. If applicable, check also the interlanguage links at the margin of the page. Note that some links go to the image description page, others just to the image itself.


 * w:File:Tile Hill train 550.jpg

w:File:Tile Hill train 550.jpg
 * w:File:Tile Hill train 550.jpg


 * en:File:Tile Hill train 550.jpg

train
 * external, with label: train


 * external, footnote style:


 * external, just the URL: http://en.wikipedia.org/upload/d/d1/Tile_Hill_train_550.jpg http://en.wikipedia.org/upload/d/d1/Tile_Hill_train_550.jpg

Revision history of pages containing images
Pages in the stored Help:page history consist of wikitext with possible references to templates and images. When viewing an old version of a page, these refer to the current versions of the templates and images, if these still exist. Thus the former composite page is not reconstructed.

Default settings
 This is the list of preferred extensions for uploading files. Uploading $wgFileExtensions = array( 'png', 'jpg', 'jpeg', 'ogg' );
 * 1) files with extensions not in this list will trigger a warning.

$wgFileBlacklist = array(	# HTML may contain cookie-stealing JavaScript and web bugs	'html', 'htm',	# PHP scripts may execute arbitrary code on the server	'php', 'phtml', 'php3', 'php4', 'phps',	# Other types that may be interpreted by some servers	'shtml', 'jhtml', 'pl', 'py',	# May contain harmful executables for Windows victims	'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' );
 * 1) Files with these extensions will never be allowed as uploads.

$wgCheckFileExtensions = true;
 * 1) This is a flag to determine whether or not to check file extensions on
 * 2) upload.

$wgStrictFileExtensions = true;
 * 1) If this is turned off, users may override the warning for files not
 * 2) covered by $wgFileExtensions.

$wgUploadSizeWarning = 150000;
 * 1) Warn if uploaded files are larger than this

Linking to an enlarged image
Unfortunately, when linking to an image, no parameters can be specified except the link label, e.g. ). Also, when linking to a template instead of embedding it, transfer of parameters is not possible.

Thus one cannot link to an enlarged image unless one has prepared a page containing that enlarged image, e.g. help:tst.png (large). The large image has been put here in the Help namespace, alternatively it could have been in;
 * the image description page (in that case some scrolling is required to see the image history and the pages using the image, but this can be made more convenient with a TOC)
 * its talk page (ditto, to see the talk)
 * a separate page in the image name space, like File:Tst.png (large).

Also, when linking to a template instead of embedding it, transfer of parameters is not possible. This would have been useful e.g. to link to an enlarged image.