Page MenuHomePhabricator

API query action=query&prop=imageinfo&iiprop=url&iiurlwidth=120&iiurlheight=120 returns urlparamnormal error on Commons File:Mohave_County_Arizona_Test.svg
Closed, InvalidPublic

Description

$ curl -X POST -d 'format=json&action=query&prop=imageinfo&iiprop=url&iiurlwidth=120&iiurlheight=120&titles=File%3AMohave+County+Arizona+Test.svg' 'https://commons.wikimedia.org/w/api.php'
{"error":{"code":"urlparamnormal","info":"Could not normalize image parameters for Mohave_County_Arizona_Test.svg.","*":"See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1282"}

API sandbox link: https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&titles=File%3AMohave_County_Arizona_Test.svg&iiprop=url&iiurlwidth=120&iiurlheight=120

Event Timeline

Anomie subscribed.

The API is correctly reporting that it could not normalize the parameters for the file. It appears the current version of the file is not a valid SVG (or so says https://commons.wikimedia.org/wiki/File:Mohave_County_Arizona_Test.svg).

@Perhelion See the merged task. It's not practical for VFC to trial and error on the list of images to process to get as much information as it can get. Suggestions?

@zhuyifei1999 Then open the other task again. It is on the first glance indeed a VFC problem. I've not looked deeper in the VFC code what information concrete are needed. But yes, anyway we need a fallback function here.

Perhelion reopened this task as Open.EditedFeb 19 2018, 4:08 AM

I reopened the task, as this is not an expectable behavior of the API (and it is also not SVG related). If we have a query list with a bunch of file titles, the whole query fails, and then we must retry the query again and again until we have all errors? There is no other method to test the imageinfo query is valid or not.

It should be a very similar behavior as a file exists check.

I fixed the gadget VFS only with try and re-loop: T187016: VFS on Commons: API request failed

It seems we can use "iiprop": "metadata" or "iiprop": "dimension" for testing probable valid thumb info.