Thumbnails

From Meta, a Wikimedia project coordination wiki

This page should serve as an outline of what to change/add in the image thumbnail functions.

Suggestions[edit]

Automated cropping[edit]

[[image:blah.jpg|thumb|crop=right10%;left15%;top5%;bottom20%|some text]]

Re-enable center tag[edit]

Caption tag[edit]

[[image:blah.jpg|caption|some text]]

Create a 'caption' tag so that captions can be easily added to images which are displayed at their actual size in articles. The only difference in look from 'thumb' tagged images, would be the absence of the box within a box icon.

Sharpening[edit]

Automated thumbnails for photos (JPEGs) should be treated with a mild sharpen filter.

Exact even number resizing[edit]

[[image:blah.jpg|thumb|~200px|some text]]

Apparently, automatically generated thumbnails look nicer when they are rescaled by an exact number (an integer: 1/2, 1/3, 1/4...) factor. For example, for a 640x480 image, a thumbnail of around 200px is requested, the best would be to generate one with a width of 213px instead, corresponding to a factor of 33.3%, or 1/3.

Thumbnail layout[edit]

It was proposed to get rid of the border around thumbnails. Alternatively, a |plain| tag could suppress border and background.

Link[edit]

[[image:blah.jpg|link=article|some text]]

Link an image to an article. Useful for e.g. the Main page.

Animated GIF thumbnail[edit]

Currently, the thumbnail of an animated GIF just shows a static frame. Thus, one reaches a dilemma if one wants to include an animation that is too big on a page -- should one just display the static thumbnail (which may lose the point of the animation)? or the oversized animation? Neither is desirable.

For example, w:Metric expansion of space#Other models of expansion shows a thumbnail with a caption saying that it's an animation, but it doesn't animate; in fact, clicking on the image still does not bring you an animation (the image page also displays a thumbnail because the animation is too large) -- you have to click on the image again to get the animation.

Would it be possible to create an animated thumbnail? i.e. an animated GIF where the frames and animation times are kept, but each frame is resized to the desired size.

In CVS[edit]

Manually generated thumbnails[edit]

[[image:blah.jpg|thumb=blah_small.jpg|some text]]

This associates the manually created thumbnail with the larger image in a machine-readable fashion. It should only be used if the manual thumbnail is of significant better quality than the automatic one, or if the manual thumbnail shows an alternate view (e.g., only a part) of the larger image.

Windows Servers[edit]

Please see the Running MediaWiki on Windows documentation for more details

Dynamic image resizing via URL[edit]

Wikimedia does URL-based image resizing on the fly as in the following example URL. You can change the number of pixels to anything and it will return the image at that size. --Nad 07:52, 18 September 2007 (UTC)[reply]

http://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/FIRE_01.JPG/700px-FIRE_01.JPG

This process uses the /wiki/thumb.php script which accepts two query-string parameters, f for the name of the image and w for the width of the re-sized image to be returned. Mod-rewrite can then be used to map requests to re-sized thumbnails to the script, eg:

RewriteCond %{REQUEST_URI} ^/files/thumb/./../.+?([0-9]+)px-(.+)$
RewriteRule ([0-9]+)px-(.+)$ /wiki/thumb.php?w=$1&f=$2 [L]

In Commons the URL is this: https://commons.wikimedia.org/w/thumb.php?f=x&w=y where x is the filename without prefix and y is a number. E.g. [1]