Page MenuHomePhabricator

Allow access to (some) structured image metadata across wikis
Open, Needs TriagePublic

Description

MediaWiki supports foreign image repositories where the image is stored on another wiki but for most purposes it appears local, and access to file contents and metadata is abstracted away via the File/FileRepo mechanism. This mechanism should support access to structured metadata. (The immediate use case is providing default alt text during page content rendering, but there are many others, e.g. more detailed license or usage or authorship information, or image annotations.)

Probably this means that the API described in T325948: Provide an API for accessing alt text (and possibly other structured data) stored with MediaWiki file uploads should be integrated with File/FileRepo, maybe in the form of a File method for getting structured metadata, which calls the internal API (e.g. a hook) for LocalFile, and calls the web API for ForeignAPIFile (which already calls the imageinfo API so it could be easily integrated with that). ForeignDBFile seems more tricky, as (unlike ForeignAPIFile) it comes with the expectation of low latency and rapid cache invalidation. It could use some web API and a cache layer shared across wikis, or some kind of cross-DB lookup.