[go: up one dir, main page]

Page MenuHomePhabricator

Add an option to the Imageinfo API to generate thumbnail URLs at the original size
Open, MediumPublic

Description

http://www.mediawiki.org/w/api.php?action=query&format=json&titles=File:MediaWiki-sysadmins-icon.svg&prop=imageinfo&iiprop=url|size&iiurlwidth=1000

This is just a totally silly return value for this API call. I mean, it makes sense with SVGs, but SVGs are the only place where this sort of response makes sense. A PNG test image successfully returns the maximum size, and the URL to the original image, for a request that goes over the limit:

http://en.wikipedia.org/w/api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=20071231235959&iiprop=url|size&indexpageids=1&format=json&iiurlwidth=1000

I'm going to fix this issue on our end, but if we could also fix the API so it doesn't give me a 50,000 pixel wide thumbnail for an SVG when I ask for it that would be FANTASTIC. (I haven't tried this yet but it seems the logical conclusion)


Version: 1.23.0
Severity: normal

Details

Reference
bz63914

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:22 AM
bzimport set Reference to bz63914.
bzimport added a subscriber: Unknown Object (MLST).

If it makes you feel better it will probably run out of memory before actually rendering a 50,000 pixel wide thumb out of an svg.

Its expected behaviour that svgs can be resized beyond their "natural" width unlike raster images. However might make sense to have some sort of upper limit for sanity on that. From a performance prespective it probably doesnt matter that much as there are the max memory/file size/cpu time limits.

(In reply to Bawolff (Brian Wolff) from comment #1)

If it makes you feel better it will probably run out of memory before
actually rendering a 50,000 pixel wide thumb out of an svg.

...not really? :)

Its expected behaviour that svgs can be resized beyond their "natural" width
unlike raster images. However might make sense to have some sort of upper
limit for sanity on that. From a performance prespective it probably doesnt
matter that much as there are the max memory/file size/cpu time limits.

Maybe there could be a per-request "limit this to the size of the image" option that only applied to vector formats? That way we don't need to deal with it on our end, it can just be part of the normal thumbnail negotiation - "give me the thumbnail that is the same size as the original SVG".

I think this is a WONTFIX. The Parser clearly allows SVGs to be rendered above their native resolution, and that is explicitly what is being requested by the API call in the bug description. Why are you passing width=1000 if that's not what you want?

AntiCompositeNumber renamed this task from SVG images with a specified width should not get rendered into PNG thumbnails that are bigger to Add an option to the Imageinfo API to generate thumbnail URLs at the original size.May 21 2020, 3:18 AM
AntiCompositeNumber edited projects, added MediaWiki-Action-API; removed Multimedia.

Imageinfo returning thumbnail URLs for arbitrary-size SVGs is a feature, not a bug. However, being able to specify iiurlwidth=original or similar would be useful for all thumbnailing processes that produce a different filetype, including multipage PDFs and TIFFs, video, STLs, and SVGs. The correct way to do this currently is to first make an API call to get the width, then make another API call to get the actual thumbnail URL.