Page MenuHomePhabricator

&redirects doesn't work properly with prop=imageinfo
Closed, ResolvedPublic

Description

Per mailing list post:

http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&titles=File:Liberia%20court%20of%20arms.png&iiprop=timestamp%7Curl%7Csize%7Cdimensions%7Cmime%7Cmetadata&redirects&format=xmlfm&iiurlwidth=128&iiurlheight=128

<?xml version="1.0"?>
<api>

<query>
  <redirects>
    <r from="File:Liberia court of arms.png" to="File:Coat of arms of Liberia.png" />
  </redirects>
  <pages>
    <page pageid="23044582" ns="6" title="File:Coat of arms of Liberia.png" imagerepository="" />
  </pages>
</query>

</api>

http://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&titles=File:Coat%20of%20arms%20of%20Liberia.png&iiprop=timestamp%7Curl%7Csize%7Cdimensions%7Cmime%7Cmetadata&redirects&format=xmlfm&iiurlwidth=128&iiurlheight=128

<?xml version="1.0"?>
<api>

<query>
  <pages>
    <page pageid="23044582" ns="6" title="File:Coat of arms of Liberia.png" imagerepository="local">
      <imageinfo>
        <ii timestamp="2009-06-01T14:04:00Z" size="14121" width="200" height="211" thumburl="http://upload.wikimedia.org/wikipedia/en/thumb/1/12/Coat_of_arms_of_Liberia.png/121px-Coat_of_arms_of_Liberia.png" thumbwidth="121" thumbheight="128" url="http://upload.wikimedia.org/wikipedia/en/1/12/Coat_of_arms_of_Liberia.png" descriptionurl="http://en.wikipedia.org/wiki/File:Coat_of_arms_of_Liberia.png" metadata="" mime="image/png" />
      </imageinfo>
    </page>
  </pages>
</query>

</api>


Version: 1.17.x
Severity: enhancement

Details

Reference
bz23750

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:04 PM
bzimport set Reference to bz23750.

john wrote:

Proposed patch

Attached:

Interestingly, I cannot reproduce this in trunk. Presumably the FileRepo code got fixed to handle redirects properly.

I'm reopening this bug, because it's causing my bot to get grumpy.

Here's the URL:
http://commons.wikimedia.org/w/api.php?action=query&redirects&titles=File:Wkwikilogo.jpg|File:WomanofTheYearScreenshot.jpg&prop=imageinfo|templates&iiprop=sha1|mime|user|comment|url|size|timestamp|bitdepth&iilimit=max&tllimit=max

I've included templates in the example above in order to show that other functions work properly; I've also tested the revisions prop, and it works properly, at least AFAIK.

You'll notice two issues with the listing of File:Woman of the Year publicity photograph.jpg:

  1. It does not include repository information
  2. It doesn't include any imageinfo.

This is bad, because it's the API isn't advertised to malfunction here. And really, there is no reason to do so.

apparently no one views bugs unless they're marked as new...

Can somebody please review the patch in comment 1 and afterwards replace the "patch-need-review" keyword by "patch-reviewed"?

Bryan.TongMinh wrote:

I think this is also fixed by I748e5223

Bryan.TongMinh wrote:

That is, I27485bba.