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

iOS: Unable to open file (which works in Kiwix elsewhere) #901

Open
kelson42 opened this issue Jun 30, 2024 · 14 comments
Open

iOS: Unable to open file (which works in Kiwix elsewhere) #901

kelson42 opened this issue Jun 30, 2024 · 14 comments
Assignees
Milestone

Comments

@kelson42
Copy link
Contributor

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.

@kelson42
Copy link
Contributor Author

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?
  • Do you ise Kiwix 3.4.0 for iOS released today?

@kelson42
Copy link
Contributor Author

  • 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!)

@kelson42
Copy link
Contributor Author

@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?

@kelson42
Copy link
Contributor Author

@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?

@kelson42
Copy link
Contributor Author

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.)

@kelson42
Copy link
Contributor Author

@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?

@kelson42
Copy link
Contributor Author

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.

@kelson42
Copy link
Contributor Author

...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!

@kelson42
Copy link
Contributor Author

@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.

@kelson42
Copy link
Contributor Author

python-libzim is a wrapper. If libzim allows it, pylibzim should as well

@kelson42
Copy link
Contributor Author

@mgautierfr ?

@kelson42
Copy link
Contributor Author

I will transfer to openzim/libzim.

@kelson42 kelson42 added this to the 9.3.0 milestone Jun 30, 2024
@mgautierfr
Copy link
Collaborator

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 #785 (and suggest we continue the discussion there)

@kelson42 kelson42 self-assigned this Jul 26, 2024
@kelson42
Copy link
Contributor Author

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.

@kelson42 kelson42 modified the milestones: 9.3.0, 10.0.0 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants