The thumbsize parameter restricts both the width and height (whichever is larger) of the desired thumbnail. For our lead image, we only need to restrict the width of the image, so we should now use the new thumbwidth parameter. (if the height of the image is significantly larger than the width, it can result in a poor-quality image because it's restricted based on height, and the width beomes proportionally smaller)
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | • Mholloway | T91144 Use thumbwidth instead of thumbsize when fetching lead image. | |||
Resolved | None | T98528 mobileview "thumbwidth" parameter doesn't always result in return of desired image url for SVG files |
Event Timeline
Hi, this is my first task. I tried looking at the code but i couldn't figure out what this task is about. I couldn't find any trace of the thumbwith parameter i the code, is it possible that it has been removed since you created task? Could you please clarify what you mean or give me some pointers where to start? Thanks in advance
@Kittensofdoom This task requires a bit of familiarity with the MediaWiki API, particularly the "mobileview" query:
https://en.wikipedia.org/w/api.php?action=help&modules=mobileview
This is what the app uses to fetch the actual page contents and metadata from the server.
If you look at PageViewFragmentInternal.java:1075, that's where we currently set the "thumbsize" parameter and pass it to the API. This needs to be changed to "thumbwidth".
Actually, looking at the code again, I think that's literally the only change that needs to be done.
@Dbrant probably should be moved to a later sprint until the blocking task is resolved.
Although this task is blocked by T98528, I wanted a fix readily available. We can merge this fix whenever that task is resolved. Here is the changeset: https://gerrit.wikimedia.org/r/#/c/245701
Change 335219 had a related patch set uploaded (by Mholloway):
Use thumbwidth instead of thumbsize when fetching lead image
Change 335220 had a related patch set uploaded (by Mholloway):
Use thumbwidth instead of thumbsize when fetching lead image
Change 335220 merged by jenkins-bot:
Use thumbwidth instead of thumbsize when fetching lead image
Change 335219 merged by Mholloway:
Use thumbwidth instead of thumbsize when fetching lead image