Images have metadata (EXIF, ...) but these metadata are currently not readable from wikitext, so it's currently not possible to have automatic information to some Wikimedia Commons templates, for example, to get description from EXIF tags.
Proposal 1: new parser function
Originally, it was proposed to add a parser function called {{#EXIF}} to use in File: namespace, which can extract metadata from EXIF tags. Then the parser function was proposed as {{#filemetadata:}} to be more generic (EXIF are not the only metadata).
[ Adding esby in CC, who wanted such a mean to print EXIF data into images descriptions ]
In 2013 a PHP patch was proposed by Brian Wolff:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/67047
⚠️ That PHP patch was abandoned in 2018. Among the reasons: there was not much consensus to create yet another parser function. Doing it in Lua seems better (confirmed by patch author).
Proposal 2: expose from Lua (all metadata)
(This proposal was abandoned)
In 2013 a Lua patch was proposed:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Scribunto/+/67588
⚠️ That Lua patch was abandoned in 2019. Among the reasons:
- it's too much complicated/confusing to expose all the metadata, because one generic metadata key could have more values
- unclear what should be done with "more expensive" metadata like DjVu/PDF with long OCR transcripts (suggested by Brian Wolff)
Proposal 3: expose from Lua (small subset)
Late proposal 2025 (revival thanks to Giovanni Pennisi): maybe Lua could "just" expose a limited selection subset of metadata. Some of them, and reasons:
- latitude
- longitude
- altitude
- bearing of destination
- (more?)
These mentioned metadata are clearly useful in at least one highly useful workflow. For example in these or similar templates:
For development, here is an example file which has latitude, longitude, altitude, bearing, in file metadata:
https://commons.wikimedia.org/wiki/File:Chiesa_di_Nostra_Signora_di_Lourdes_-_2024-09-01_rear.JPG
Maybe Lua could expose a simple associative table with the mentioned keys, and a single value. Partially like MediaWiki does on the file page.
For example exposing such table or something similar:
local metadata = { GPSLatitude = 37.5283972222222, GPSLatitudeRef = "North", GPSLongitude = 15.084325, GPSLongitudeRef = "East", GPSAltitudeRef = "Above Sea Level", GPSAltitude = "97.2340584", GPSDestBearingRef = "True North", GPSDestBearing = 161.4809877, }
See Also: