Unlike bitmap images, small SVG images are upscaled by PageImages to match the requested size, but the original size is reported, which is incorrect. This prevents Hovercards from displaying the image. For downscaled images, the size after downscaling is reported, which is correct.
Steps to reproduce:
- Let the image https://en.wikipedia.org/wiki/File:Strait.svg be a SVG with nominal size 166 × 188 px.
- Get https://en.wikipedia.org/w/api.php?action=query&format=xml&prop=pageimages&titles=Strait&pithumbsize=300
Expected result
<page _idx="58646" pageid="58646" ns="0" title="Strait" pageimage="Strait.svg"> <thumbnail source="https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Strait.svg/265px-Strait.svg.png" width="265" height="300"/> </page>
Actual result [BUG]
<page _idx="58646" pageid="58646" ns="0" title="Strait" pageimage="Strait.svg"> <thumbnail source="https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Strait.svg/265px-Strait.svg.png" width="166" height="188"/> </page>
Expected & Actual result [OK]
<page _idx="58646" pageid="58646" ns="0" title="Strait" pageimage="Strait.svg"> <thumbnail source="https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Strait.svg/88px-Strait.svg.png" width="88" height="100"/> </page>