Page MenuHomePhabricator

Wikimedia REST API api/rest_v1/page/media-list should return image dimensions / resolution
Open, Needs TriagePublicFeature

Description

Feature summary : The API currently gives multiple sizes of the images from the page but it provides no indication what the sizes actually are even though the URL of the image will often contain resolution information e.g. "upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_the_People%27s_Republic_of_China.svg/640px-Flag_of_the_People%27s_Republic_of_China.svg.png"

Use case(s) : I'm building a UI that is trying to show users compelling images from a Wikipedia article. But it's not worth showing tiny images or images with really odd aspect ratios. My option currently is to fetch the images and then discard the ones with bad resolutions. I guess the scale indicators are meant to help with this but the docs do not indicate what "1.5x" means. Actually the "srcset" param of the response doesn't seem to be documented at all? I also can't find documentation on "showInGallery".

Benefits (why should this be implemented?):

  • easier to use the API
  • reduced on servers from fetching images that are never shown
  • better documentation