Page MenuHomePhabricator

Parsoid doesn't include the main image for a File page
Closed, ResolvedPublic

Description

https://en.wikipedia.org/api/rest_v1/page/html/File%3ARon_Rivera_(cropped).jpg does not show the main image the File page is about.
(It redirects to https://commons.wikimedia.org/api/rest_v1/page/html/File%3ARon_Rivera_(cropped).jpg. Not sure if that is pertinent here.)

pasted_file (782×869 px, 221 KB)

https://en.wikipedia.org/wiki/File:Ron_Rivera_(cropped).jpg shows an image.

pasted_file (708×873 px, 568 KB)

This is a followup task of T135242: [BUG] Image not shown for Content Service file pages, where the Android app added a workaround by not using Parsoid for File pages.

Event Timeline

I think there are good reasons for keeping the skin responsible for composing special pages like those for images. This keeps things flexible, and avoids mixing actual user-controlled content (image description) with auto-generated content (image itself, category trees etc).

That said, we could provide a default, "skinned" view for such pages that works for most use cases.

@GWicke I'm not sure I follow. The skin cannot be responsible when the page is formatted like so - the image url doesn't appear to be anywhere.

Any reason we cannot provide an array of urls for the different resolutions?

@Jdlrobson, I'm not at all opposed to setting up a nice API exposing the metadata needed to render such a page in the skin, or even provide a basic default rendering. To avoid providing a limited list of resolutions, we have been looking into a proper thumb & image info API that lets clients select resolutions in T66214.

My point is that Parsoid shouldn't be in the business of implementing random skin functionality, like rendering image pages, special pages, or category pages.

So @bearND it sounds like the MCS might want to do a fetch to mwApi and enrich the response with that information.

@Jdlrobson Good idea. I'll move it to the backlog.

Change 326178 had a related patch set uploaded (by Jdlrobson):
Add additional information to file and user pages for rendering

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

Change 326178 merged by jenkins-bot:
Add additional information to file and user pages for rendering

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

bearND claimed this task.

deploy/2017-01-04/c39bd1f

Change 392078 had a related patch set uploaded (by Niedzielski; owner: Sniedzielski):
[marvin@master] Update: show image on image File pages

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

Change 392078 merged by jenkins-bot:
[marvin@master] Update: show image on image File pages

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