Template:ExposureTimeBeautifier

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 category system on Wikimedia Commons and looks much cleaner.

Usage

{{ExposureTimeBeautifier |1= }}

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, nothing 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:

  • {{ExposureTimeBeautifier|1.33333}} is rounded to 1.3
  • {{ExposureTimeBeautifier|10/1}} is simplified to 10
  • {{ExposureTimeBeautifier|10/2500}} is reduced to 1/250
  • {{ExposureTimeBeautifier|10/16}} is reduced to 5/8