Page MenuHomePhabricator

imageinfo API returns incorrect data
Closed, ResolvedPublic

Description

In this call http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&titles=File%3APowderfinger-My_Happiness-23s.ogg&iiprop=size%7Curl&iiurlwidth=200 it returns thumbwidth="1913" thumbheight="-1" as a size of an thumb, which is completly wrong.


Version: master
Severity: normal

Details

Reference
bz49921

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:45 AM
bzimport added a project: TimedMediaHandler.
bzimport set Reference to bz49921.
Inez created this task.Jun 21 2013, 12:21 AM

There are actually two bugs going on here.

First, TimedMediaHandler isn't normalizing dimensions for audio files, which means that the height=-1 being passed to indicate "don't limit by height" is being misinterpreted.

And second, TimedMediaHandler is using an incorrect calculation when the height is the limiting factor on the thumbnail dimensions, leading to the width of 1913. The same happens if you pass something like iiurlwidth=220&iiurlheight=10.

Since both of these are in TimedMediaHandler, I'm going to reassign this there. I'll also submit a patch momentarily.

Related URL: https://gerrit.wikimedia.org/r/69869 (Gerrit Change Ide7208394f8495f5b143cbba215d4645598f1a50)

(In reply to comment #2)

Related URL: https://gerrit.wikimedia.org/r/69869 (Gerrit Change
Ide7208394f8495f5b143cbba215d4645598f1a50)

This has been merged, and went out with wmf9. However, given that wmf8 is on the servers for an extra week and it makes really not-nice behaviour in VisualEditor, we probably want to back-port this.

Change 71393 had a related patch set uploaded by Catrope:
Clean up transform dimension height handling

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

Change 71393 merged by Catrope:
Clean up transform dimension height handling

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

This backport is now live; as such, marking this bug as fixed.

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:21 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:22 AM