Open kelson42 opened 3 months ago
Thank you @stuartlangridgemmformyour issue, you should definitly be able to open your ZIM files and have a similar user experience on all versions of Kiwix.
Let me as you two questions:
- How have you created your ZIM file? With which tool?
I used the Python bindings for libzim to create my zim file, as packaged in Ubuntu 22.04. These seem to be 1.0.0+ds-2build1, based on libzim in Ubuntu which is version 7.2.0-2build1.
I was not using v3.4.0 of Kiwix for iOS, but I have just updated to that and tried again and I have the same issue.
(I should note that I have opened a different zim file from inside the Kiwix interface and that worked, so my Kiwix installation for iOS isn't completely broken or anything!)
@stuartlangridge OK, then its looks like a bug. Would you be able to share the ZIM file, or any ZIM file suffering of the bug?
@stuartlangridge It seems as well that you use a very old version of python-libzim, any chance you could use the latest version published on pypi?
I have just tried using libzim
from pypi, and I still get the problem, it seems. You can grab a small example file which shows the problem (it loads fine in kiwix-desktop, but does not in kiwix-ios) and was created with up-to-date PyPI install from https://kryogenix.org/random/fr-small-pip.zim.
(I'm quite prepared to believe that I'm creating the zim file wrong in some way! but it does open in kiwix-desktop, so it can't be completely wrong. It might be useful, if the file really is created incorrectly, if kiwix-ios gave some direction as to why the file can't be loaded, to help people who create their own zim files.)
@stuartlangridge I rna zimcheck
against your file, and I see:
[ERROR] Metadata errors:
Missing mandatory metadata: Language
Missing mandatory metadata: Date
Missing mandatory metadata: Illustration_48x48@1
At this stage, I guess there is 50% chance that the rootcause of the problem is there because these Metadata are mandatory in the ZIM spec. Would you be able to set them and try again?
Aha, I didn't know there was a zimcheck tool! Now that I know that I'll try again and verify with zimcheck, thank you.
...and that has indeed fixed it! My created zim file now opens fine in Kiwix for iOS, now that I've added language, date, and illustration.
I shall file a bug against the python libzim bindings because their example code in their README does not include these mandatory elements, but this bug can be closed, and thank you!
@rgaudin @benoit74 Actually I believe this is not really normal that a ZIM file can be written without error by python-libzim if the ZIM file can not be open afterward.
python-libzim is a wrapper. If libzim allows it, pylibzim should as well
@mgautierfr ?
I will transfer to openzim/libzim
.
Actually I believe this is not really normal that a ZIM file can be written without error by python-libzim if the ZIM file can not be open afterward.
Well, it seems that is a issue with iOS only. Probably because iOS expect some metadata and fail if they are not there. From user itself, it seems that open the file is ok on other readers.
python-libzim is a wrapper. If libzim allows it, pylibzim should as well
I agree.
Libzim itself can read such a file (and it is a good thing, else zimcheck would not be able to open it to check it). So on the reading side we are good.
On the creation side, I refer you to https://github.com/openzim/libzim/issues/785 (and suggest we continue the discussion there)
We should clarify what is blocking for opening a file at libzim level and at Kiwix levels. Once agreement on this, check that implementations are correct.
From kiwix-apple created by stuartlangridge: kiwix/kiwix-apple#842
I have created a .zim file for myself, and it happily opens in kiwix-desktop on Ubuntu. However, when I download that file (with Safari) on my iPhone, and then try to open it in Kiwix for iOS from the Downloads folder, Kiwix responds "Unable to open file: blah.zim cannot be opened". Is there any way I can find out why it can't be opened, so I can work to resolve it? There does not seem to be a way; the syslog on the device does not seem to mention the file by name, so I don't think that Kiwix is NSLog()ing a failure reason, although I might be wrong about that. I did not (and cannot) compile my own Kiwix; I'm just using the one from the Apple app store for iOS.