Using Images from Wikimedia Commons

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


The mh370wiki.net website uses many images which have been uploaded to the Wikimedia Commons website. These are listed and referenced on the page References/Wikimedia Commons.

Images on Wikimedia Commons are generally already in the public domain, or free under Creative Commons licences.


Wikimedia Commons and the MediaWiki software are projects of the Wikimedia Foundation. Consequently, there is a simple way to include images from Wikimedia Commons into a MediaWiki-based website.


InstantCommons

The variable $wgUseInstantCommons enables a MediaWiki-based website to use images from Wikimedia Commons.

In recent versions of MediaWiki, the images are hotlinked and are not downloaded and stored locally. This means the wiki behaves like other Wikimedia projects. For example, Wikipedia (another Wikimedia Foundation Project) extensively uses images from Wikimedia Commons and on any image source page there is likely to be a list of Wikipedia country-based sites which use that image.

To enable Instant Commons, insert the following into LocalSettings.php:-

$wgUseInstantCommons = true;

In many installations the value will be true by default and InstantCommons will work without any action needed.


Example

The aircraft which went missing on Flight MH370 (8 March 2014) was a Boeing 777 operated by Malaysia Airlines and registered 9M-MRO. Many photos of this aircraft and other images related to the tragedy have been uploaded to Wikimedia Commons. One chosen for an example here is located on this page Boeing 777-200ER (The file name in the URL is too long to show here.)

Every image page on the Wikimedia Commons website has a menu with different options for re-use of the image.

Select 'Use this file on a wiki'. Two options will be presented - a link to use the full image, or a thumbnail. The full text is longer than the width of the dialogue box.

Select the text for the Image. It looks like this:-

[[File:20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche.jpg|20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche]]

To use the image, simply place that text into a page. Here is the example:-

20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche

Adjusting Image Size

The MediaWiki documentation Help:Images describes how to format and resize images in the format

[[File:filename.extension|options|caption]]

The same image has been resized to a width of 500 pixels as shown here:-

[[File:20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche.jpg|20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche|500px]]

20140320150428!Boeing 777-200ER Malaysia AL (MAS) 9M-MRO - MSN 28420 404 retusche

For More Control

Most of the images used in the mh370wiki.net website have been downloaded and are then sourced locally. As explained in the article Configuring MediaWiki for Images these are not stored in the default /w/images directory. Consequently each image is loaded using the html <img tag. In addition, the images are styled using custom css. Most have rounded corners; images of passengers are presented in sepia tones; images may be placed using float; image size is defined by css width; and right-click is generally disabled so various actions are disabled.


Links

Help:Images
https://www.mediawiki.org/wiki/Help:Images
InstantCommons
https://www.mediawiki.org/wiki/InstantCommons
Manual:$wgUseInstantCommons
https://www.mediawiki.org/wiki/Manual:$wgUseInstantCommons