Page MenuHomePhabricator

REST API `mobile-html` end-point thumbnails resolution are too big
Closed, ResolvedPublicBUG REPORT

Description

Look for example at:
https://bm.wikipedia.org/api/rest_v1/page/mobile-html/Bamak%C9%94

Images:

  • First (real) image "Bamako_et_fleuve_Niger.jpg" width is 320px. It was 250px with the old mobile-section API
  • Second (real) image "Bamako_bridge2.jpg" width is 640px. It was 250px with the old mobilde-section API

If we look to the wiki code it is:

[[Fichier:Bamako_et_fleuve_Niger.jpg|thumb|250px|Bamako]]
[[Fichier:Bamako bridge2.jpg|thumb|250px| Bamako Pont, mi bɛ Niger baw kan]]

The images size should:

  • Respect the wiki code
  • Be mobile friendly

This bug has a very serious impact on MWoffliner and ZIM snapshots for Kiwix: the team has implemented the support of mobile-html but the ZIM snapshots are far too big to be distributed.

MWoffliner at ticket https://github.com/openzim/mwoffliner/issues/1925

Event Timeline

Kelson updated the task description. (Show Details)

Change #1016333 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[mediawiki/services/mobileapps@master] Store original image src as data attribute

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

Change #1016333 merged by jenkins-bot:

[mediawiki/services/mobileapps@master] Store original image src as data attribute

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

Change #1020274 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[mediawiki/services/mobileapps@master] Preserve original src data attribute on lazy load transformation

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

Change #1020274 merged by jenkins-bot:

[mediawiki/services/mobileapps@master] Preserve original src data attribute on lazy load transformation

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

Jgiannelos claimed this task.

image.png (1×2 px, 566 KB)

PCS now serves mobile-html with data-file-original-src to indicate that the image was upscaled.