Template:ExposureTimeCategory

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]

This template transforms exposure time values extracted from the EXIF tags of an image into a format that matches the existing categories on Wikimedia Commons. The corresponding category is then added to the file page where this template is used.

The template automatically sets the following categories:

Usage

{{ExposureTimeCategory |1= }}

If a corresponding category is not (yet) available, files will additionally be placed in Category:Exposure time category unavailable.

Corrections performed by the template:

  • Force decimal notation for values greater than 1.
  • Round to one digit after the decimal mark.
  • Try reducing the fraction. Only tests for division by the value of the numerator, by 2 and by 5 are performed, as by far the most common numerator in EXIF exposure time data apart from 1 is 10.

Division by zero is caught, no category is shown at all for values at or below 0.

Template parameters

ParameterDescriptionDefaultStatus
1Exposure TimeValue of the exposure time, usually taken from EXIF information in the file.0required

Additional information

The template is intended to be used in the following namespaces: the File namespace

The template is intended to be used by the following user groups: all users

Localization

This template is not intended to be localized.

Examples

Examples for the corrections that are performed by the template:

  • {{ExposureTimeCategory|1.33333}} is rounded to [[Category:Exposure time 1.3 sec]]
  • {{ExposureTimeCategory|10/1}} is simplified to [[Category:Exposure time 10 sec]]
  • {{ExposureTimeCategory|10/2500}} is reduced to [[Category:Exposure time 1/250 sec]]
  • {{ExposureTimeCategory|10/16}} is reduced to [[Category:Exposure time 5/8 sec]]