-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images from page/mobile-html endpoint are too big #1925
Comments
No "Its not appropriate for a mobile end-point AFAIK". See https://www.browserstack.com/guide/ideal-screen-sizes-for-responsive-design#toc2. We should report this as a bug not as feature request. |
Bug report done at https://phabricator.wikimedia.org/T349972 |
Be careful that you're looking at the raw HTML served to the browser, not the HTML as modified by the lazy-loading mechanism. Fetching that HTML gives:
There's no actual The more fundamental question is whether or not kiwix wants to be fetching the "mobile HTML" in the first place, as opposed to the HTML used for desktop browsing. |
Yes, this really a pain to have a public API not delivering proper HTML! But:
Not sure what I should answer here... basically you ask us to (for each picture):
Do I get that right? Because that sounds just very difficult and error prone to do... in particular why Wikimedia could not generate proper HTML (respecting both the given wiki code AND the mobile constraints) in a first place? More or less like before?
We want to serve our users properly... and the world goes mobile... Wikimedia goes mobile... Why should Kiwix do differently? |
Well, in this case it's because the "mobile HTML" is optimized for an entirely different use case than yours -- one where we want to save bandwidth by deferring the loading of images as long as possible. All the things you are asking for are present in the standard ("non-mobile") Parsoid HTML. |
@cscott The lazy loading is a non-topic here. Can we focus on the bad sizes of the images which IS the problem. |
Re-opening. The code added in #2043 to fix this code doesn't "work", in the sense that the retrieved images (in 1.14) end up being larger than those from the previous Here is a summary of my understanding of the issue:
|
@kelson42 what do you think? The only solution I can think of is to dig up the code for |
I see that @VadimKovalenkoSNF had the same idea a while ago: #1903 (comment)
|
A third option is to use I hesitate to suggest this (and it's somewhat out of scope of this issue), but this could actually be an opportunity to provide an API in mwOffliner ZIMs to use any of the Wikimedia-provided styles: Vector, Vector legacy, MinervaNeue, MonoBook and Timeless. It's really just a bunch of CSS transforms in a bundled stylesheet applied over neutral HTML. I mean, of course there are gotchas, and I'm not saying it would be quick to provide the full functionality, but if designed right, the API could start with a simple transformation to a generic mobile style, possibly Vector, and then add the others as CSS packs later. See also #2086. Just a thought. It's probably too difficult and/or too expensive in dev time to do something like this for 1.14, but if we're really stuck, it's always worth having alternatives to consider...😉 |
See #2107 for the follow-up issue. |
WikimediaMobile API in #1903 relies on page/mobile-html endpoint when scraping Wikipedia articles. Most of the images that come from mobile-html are 640px in width which is not appropriate for the scrape process, because of the drastic increase of the final zim file. Check this article's images as an example - https://bm.wikipedia.org/api/rest_v1/page/mobile-html/Bamak%C9%94
Pay attention to width value in src attribute for each image, e.g https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Bamako_bridge2.jpg/640px-Bamako_bridge2.jpg has /640px placed there by mediawiki mobileapps service.
Related ticket in Phabricator: https://phabricator.wikimedia.org/T348529
The text was updated successfully, but these errors were encountered: