Skip to content
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

Failure to display images on .zim files #27

Closed
ghost opened this issue Mar 18, 2022 · 12 comments
Closed

Failure to display images on .zim files #27

ghost opened this issue Mar 18, 2022 · 12 comments
Labels
question Not a bug.

Comments

@ghost
Copy link

ghost commented Mar 18, 2022

Images of the Wiktionary in .zim format are not shown properly:

xiaoyifang german wiktionary

To reproduce:
Download a Wiktionary/Wikipedia with images on https://wiki.kiwix.org/wiki/Content_in_all_languages

OS: Manjaro Linux KDE (Latest Stable)
Version: https://aur.archlinux.org/packages/goldendict-webengine-git

image

@xiaoyifang
Copy link
Owner

xiaoyifang commented Mar 18, 2022

more likely dictionary's issue.

you can use F12 to inspect the image element.
the original img is more likely small or the css style is wrong.

or another way to check:
save the article through menu ,then open the saved html in chrome.

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Mar 18, 2022

I downloaded some English .zim and works OK for me. Maybe you should mention exactly which one has this problem?

I think the possible cause is that

Deutsche Wiktionary is using this|Bild 1=Fuji_apple.jpg|200px|1|''Apples'' to include image which result an image inside <table> as in https://de.wiktionary.org/w/index.php?title=Rahmen&action=edit

English Wiktionary is using [[Image:Apple red delicius flower end.jpg|thumb|A red apple]] which result an image inside <div> as in https://en.wiktionary.org/w/index.php?title=apple&action=edit

Perhaps Deutsche Wiktionary could use some update? Or the tool that convert that Wiktionary messed up the <table> element?

If the saved HTML as mentioned above works in chrome but not GD, then the issue belong to here.

If it doesn't work, then exported .zim should be blamed.

@xiaoyifang xiaoyifang added the question Not a bug. label Mar 19, 2022
@ghost
Copy link
Author

ghost commented Mar 19, 2022

Thanks for your kind help.

The German Wiktionary .zim works perfectly on "Kiwix" on Android:

159142702-e9f9c555-507f-4888-a2fd-7a9143ad0769

The images for the word "Rahmen" in German Wiktionary appear properly on Kiwix but on GoldenDict those images are not shown correctly.

The issue affects your improved version of GoldenDict. I guess that also affects the "Official" version maintained by @Abs62 .

Several months ago I contacted the "Kiwix Team" by email and they said about GoldenDict and .zim files:

"I'll be honest I had to ask about GoldenDict because I'd never heard of it. Turns out someone here had heard of it not too long ago but did not have time to investigate much. The only finding so far is that it uses Pylibzim for its own purpose, and thus probably can not fully read all the zim files we produce (as illustrated by the issue you refer to; I don't know about non mediawiki zim files). "

So, probably GoldenDict just does not support .zim files properly. Maybe could we improve that with the @kiwix Team @Popolechien ?

Thanks for your hard work !

@xiaoyifang xiaoyifang reopened this Mar 20, 2022
@ghost
Copy link
Author

ghost commented Mar 20, 2022

NEW FINDING: 1) If the German Wiktionary is in a group ALONE, images are shown correctly.
2) If it is put on a Group with other dictionaries, there is a misconfiguration and the bug appears.

On the group there are HTML-based dictionaries (.mdx) and some of them might have a "bad" behaviour affecting the display of other dictionaries:

Check: goldendict/goldendict#290
http://goldendict.org/forum/viewtopic.php?f=4&t=2091&start=110

The issue of HTML dictionaries affecting global styles was supposedly fixed by @Abs62 on 2013 but it still alive !

On the other hand, the support for .zim files was added on 2013 on GoldenDict and some changes have happened since them on Python "libzim" and/or zim format.

@xiaoyifang
Copy link
Owner

xiaoyifang commented Mar 20, 2022

  1. If it is put on a Group with other dictionaries, there is a misconfiguration and the bug appears.

On the group there are HTML-based dictionaries (.mdx) and some of them might have a "bad" behaviour affecting the display of other dictionaries:

then it was affected by other dictionary's css style. dictionary hasn't have a standard css writing rule. and some dictionary use js to control the style. which is out of gd's ability to support.

I can conculed that ,with the same dictionaries and settings ,the original gd also has this issue.

On the other hand, the support for .zim files was added on 2013 on GoldenDict and some changes have happened since them on Python "libzim" and/or zim format.

will investigate in the future ,but I think it has not related to this issue.

@ghost
Copy link
Author

ghost commented Mar 20, 2022

Unfortunately, a single "bad" .mdx dictionary was affecting others (Forvo German Pronunciations: https://forum.freemdict.com/t/topic/7355/7 )

I am very sorry. It was difficult to pinpoint the issue. Thanks to everyone for their valuable help and insights !

@ghost ghost closed this as completed Mar 20, 2022
@xiaoyifang
Copy link
Owner

On the other hand, the support for .zim files was added on 2013 on GoldenDict and some changes have happened since them on Python "libzim" and/or zim format.

will investigate in the future ,but I think it has not related to this issue.

gd seems do not use any libs to parse the zim format ,it just parse the file itself.

@data-man
Copy link
Contributor

gd seems do not use any libs to parse the zim format ,it just parse the file itself.

Yes. Some time ago I proposed to use libzim in GD, but the author doesn't want it.

@xiaoyifang
Copy link
Owner

gd is gpl3.0+ while libzim is gpl2.0 ,will there be any license issue to use the lib.

@xiaoyifang
Copy link
Owner

goldendict/goldendict#914

@Popolechien
Copy link

gd is gpl3.0+ while libzim is gpl2.0 ,will there be any license issue to use the lib.

@xiaoyifang Please open a ticket at openzim/libzim but we think that GPL 2.0 is more permissive so this should not be an issue.

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Mar 21, 2022

Actually, they explicitly changed from GPL2 to GPL2+

openzim/libzim@f57bca2

Plus this chart from gnu.org

https://www.gnu.org/licenses/gpl-faq.en.html#AllCompatibility

their previous discussion on this matter

openzim/libzim#30

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug.
Projects
None yet
Development

No branches or pull requests

4 participants