-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Support thumb.php
thumbnails (was: All images are missing in ZIM)
#2088
Comments
Sorry if this is a naive observation, but when I go to the config tab of that Zimfarm recipe I see:
Does that make a difference? |
Very interesting at https://dev.library.kiwix.org/viewer#psychonautwiki_en_all_maxi_2024-09/ because first picture is there but not the others. My best guess:
|
This means (sorry if you already know that, but your question is unclear so I prefer to give too much info) that we want two ZIMs, Having both formats in a single run is supposed to work well (but could be the source of the issue, didn't tried to reproduce with only |
Running the command from zimfarm on 1.14-dev, I get a lot of:
Not sure if this is a problem (it's in the logs as just a warning). |
@audiodude unrelated but we should open a dedicated issue about that. It has no impact beside flooding the logs with not relevant stuff. |
This looks like a clue: https://psychonautwiki.org/w/thumb.php?f=Map-of-world-cannabis-laws.svg.png&width=801 |
Nevermind the above, I think I've figured it out. The renderer embeds But the downloader creates the file in the ZIM with the filename My guess is that this is because mwoffliner doesn't expect image paths to end in |
Well I was mostly right. At article render time, we guess the mime type based on the file extension. Types that include |
So my first theory on how to fix this is to store the images in the ZIM as Is it true that we can only convert jpg/png to webp? Otherwise, if a URL appears in the |
thumb.php
thunmails (was: All images are missing in ZIM)
thumb.php
thunmails (was: All images are missing in ZIM)thumb.php
thumbnails (was: All images are missing in ZIM)
@audiodude Thank you for having run the analysis. I don't see anything in your comments I could disagree with. Let me try to maybe give a few additional information, the fix might not be that complicated. First of all I have to apologize to have part of MWoffliner relying on the filename/URL to identify if we deal with an "image" or not. It's not the right way of doing. The right way of doing is to deal with the HTTP Response mime-type (what we do to some extend) and the idea of doing this depending of the (HTML) context is also an interesting one. But at the time we needed this (introduction of the .webp optimisation?) we had not the resources to do the massive re-engineering to do that in the "right" way. I'm not sure that these days, we have more resources to do that properly, so we will probably have to keep current architecture. Yes, "images" potentially converted to webp are jpg and png. The good news is that all these identifications are based on regexps which are all in What I suspect here is that we face two bugs:
All of this should be doable in less than 20 lines, tests included. @audiodude Does that make sense? Considering that this is a kind of serious bug (but not a regression AFAIK), should we keep it in the milestone or postponed it? |
Yes, this would be a major undertaking, because right now the code that writes the article HTML (with the
I think this is the same thing that I suggested. If the path includes
Does this mean re-running the filename mime type detecting (regex based on path) at the time that we are downloading the image/converting to webp, and refusing to do the conversion if the detection doesn't produce
Given how delayed 1.14 is, and considering that as you pointed out it's not a regression, I would recommend postponing. |
We should extract proper filename (with proper extension) from the whole URL. |
Yes this what i suggest. |
This week-end we ran the
dev
Docker image on a MediaWiki and resulting ZIM seems to have no image at all.ZIM online: https://dev.library.kiwix.org/viewer#psychonautwiki_en_all_maxi_2024-09/
Zimfarm recipe: https://farm.openzim.org/recipes/psychonautwiki_en_all
ZIM request: openzim/zim-requests#634
Sorry if this is a duplicate (I didn't found such a precise issue in the backlog), but this might be an interesting issue for you since MediaWiki is quite small and all images seems to be broken.
The text was updated successfully, but these errors were encountered: