Page MenuHomePhabricator

Find alternative files in different formats
Closed, ResolvedPublic

Description

Some images on commons.wikimedia have converted the file format to other formats. For example the SVG file https://commons.wikimedia.org/wiki/File:Codabar-example.svg has png formats available (https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Codabar-example.svg/705px-Codabar-example.svg.png)

I can get the url of the SVG file using page.fileUrl(), but there doesnt seem to be a method to get the URL of the png files.

Event Timeline

Danny_B renamed this task from pywikibot: Find alternative files in different formats to Find alternative files in different formats.Jun 6 2016, 3:56 PM

The png are generated urls with options added by the requester; any px value should work.

Agreed we should have a method to simplify this.

The Mediawiki component for this is called the image scaler iirc.

Note that for multipage files, the following is available:
https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Stories_by_Foreign_Authors_%28French_II%29.djvu/page32-162px-Stories_by_Foreign_Authors_%28French_II%29.djvu.jpg

Note page30 (it could be any page).
Note that it is a jpg file.

It should be investigated on which base file format is chosen and how a multipage file is detected.

Change 293626 had a related patch set uploaded (by Mpaa):
Add thumburl informations to FileInfo

https://gerrit.wikimedia.org/r/293626

Change 293626 merged by jenkins-bot:
[pywikibot/core@master] Get thumburl information in FilePage()

https://gerrit.wikimedia.org/r/293626

Xqt claimed this task.
Xqt reassigned this task from Xqt to Mpaa.
Xqt subscribed.