Page MenuHomePhabricator

Incorrect image dimension received in HTML fetched using mobile version of rest api
Open, Needs TriagePublic

Description

If I go to russian Wikipedia ТЭМ2 and in the source code search for Tem2-215 observe that the width of the image received is 120 for the thumbnail. But, when I use the mobile version to fetch the content the width is not the same for the exact same element.

Event Timeline

From https://ru.wikipedia.org/api/rest_v1/page/mobile-sections/%D0%A2%D0%AD%D0%9C2 (please include expected and actual results, see https://www.mediawiki.org/wiki/How_to_report_a_bug ):
<div class=\"thumb\" style=\"width: 150px; height: 150px;\"><span><a href=\"/wiki/Файл:Tem2-215.jpg\" class=\"image\"><img src=\"upload.wikimedia.org/wikipedia/commons/thumb/5/54/Tem2-215.jpg/300px-Tem2-215.jpg\" data-file-width=\"800\" data-file-height=\"604\" data-file-type=\"bitmap\" height=\"227\" width=\"300\" srcset=\"upload.wikimedia.org/wikipedia/commons/thumb/5/54/Tem2-215.jpg/450px-Tem2-215.jpg 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/54/Tem2-215.jpg/600px-Tem2-215.jpg 2x\"></a></span></div>

@Aklapper The problem is clearly visible (from a user perspective) on the REST desktop HTML as well, look at:
https://ru.wikipedia.org/api/rest_v1/page/html/%D0%A2%D0%AD%D0%9C2#%D0%93%D0%B0%D0%BB%D0%B5%D1%80%D0%B5%D1%8F

I believe the rendering reported first at https://github.com/openzim/mwoffliner/issues/1428 to be obviously visible.