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

Downloading favicon for book is not working for Apple (iOS/macOS) #1180

Open
BPerlakiH opened this issue Feb 21, 2025 · 7 comments · May be fixed by kiwix/kiwix-build#807
Open

Downloading favicon for book is not working for Apple (iOS/macOS) #1180

BPerlakiH opened this issue Feb 21, 2025 · 7 comments · May be fixed by kiwix/kiwix-build#807
Assignees
Milestone

Comments

@BPerlakiH
Copy link

BPerlakiH commented Feb 21, 2025

On Kiwix Apple, we are using the libkiwix function to get the image data for the books, like so:

https://github.com/kiwix/kiwix-apple/blob/820869b2d9ddc40f88b6ed1f9f4a0bd3f0de128a/Model/Entities/ZimFileMetaData/ZimFileMetaData.mm#L159-L170

Unfortunately for all books, this function comes back with an error, and no data is returned.
We fall into the catch block here:

std::cerr << "Cannot download favicon from " << url;

I am not sure if it's Apple only specific, but it's consistently failing for every book, that we just fetched from the catalog.

@rgaudin
Copy link
Member

rgaudin commented Feb 21, 2025

@BPerlakiH is this related to that old ticket? kiwix/kiwix-apple#789 (comment)

@BPerlakiH
Copy link
Author

@rgaudin Yes it seems so, it is the very same function that we are referring to.

@kelson42
Copy link
Collaborator

@veloman-yunkan Is this function working at all? tested properly?

@veloman-yunkan
Copy link
Collaborator

@kelson42 I don't think that it is tested properly. I see a potential issue with it when the illustration's URL points to a redirected address (I don't consider the obvious silly case when the favicon's URL is plain wrong).

We fall into the catch block here:

std::cerr << "Cannot download favicon from " << url;

Does this debugging statement work? Does it print the problematic URL? Is the resource at that URL accessible? What is the HTTP response to a GET request to that URL?

@kelson42
Copy link
Collaborator

@BPerlakiH Please share the detail for a failing example so we get a chance to fix the bug. This is a priority.

@BPerlakiH
Copy link
Author

This is the message we get back on the console:

Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/3511345c-4221-d9dd-23d8-60e88335d77f/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/0d17fed5-29f0-a0f0-4c7b-867450270337/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/1d66634a-510d-2c69-0def-9a0e942c1904/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/4d116654-e346-5b27-9dbe-f4cbac2f98e7/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/36b01178-ee2b-e96f-9e96-0aee09cdce19/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/5cdfea60-726b-03c8-4a6e-1e18392af505/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/9178576f-9bc4-ba73-abe1-cd9c83881a21/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/18d09afb-88c2-1c1d-31ba-992ec59f6beb/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/f7199730-8153-357c-d302-d9f3baf0f357/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/6e6211db-63a1-52eb-8554-340f7af9795f/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/c43c593d-006e-538d-621e-a67cd2227d5f/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/1901a4d3-29b0-0f07-26d7-94d849f3d883/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/2e9bcc9f-420a-fa75-73cd-c322d445c089/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/40dcb30d-56c3-238c-d1b2-6d7d89d929bc/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/7d493deb-2f5c-8f0a-56e1-43d66e418238/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/cc525677-62fb-554e-5f94-0574126baf03/?size=48Cannot download favicon from https://library.kiwix.org/catalog/v2/illustration/5798dc0f-b0e6-da75-53d9-d991cd6933ff/?size=48

and the list goes on..

If I parse out the urls:

https://library.kiwix.org/catalog/v2/illustration/3511345c-4221-d9dd-23d8-60e88335d77f/?size=48
https://library.kiwix.org/catalog/v2/illustration/0d17fed5-29f0-a0f0-4c7b-867450270337/?size=48
https://library.kiwix.org/catalog/v2/illustration/1d66634a-510d-2c69-0def-9a0e942c1904/?size=48
https://library.kiwix.org/catalog/v2/illustration/4d116654-e346-5b27-9dbe-f4cbac2f98e7/?size=48
https://library.kiwix.org/catalog/v2/illustration/36b01178-ee2b-e96f-9e96-0aee09cdce19/?size=48
https://library.kiwix.org/catalog/v2/illustration/5cdfea60-726b-03c8-4a6e-1e18392af505/?size=48
https://library.kiwix.org/catalog/v2/illustration/9178576f-9bc4-ba73-abe1-cd9c83881a21/?size=48
https://library.kiwix.org/catalog/v2/illustration/18d09afb-88c2-1c1d-31ba-992ec59f6beb/?size=48
https://library.kiwix.org/catalog/v2/illustration/f7199730-8153-357c-d302-d9f3baf0f357/?size=48
https://library.kiwix.org/catalog/v2/illustration/6e6211db-63a1-52eb-8554-340f7af9795f/?size=48
https://library.kiwix.org/catalog/v2/illustration/c43c593d-006e-538d-621e-a67cd2227d5f/?size=48
https://library.kiwix.org/catalog/v2/illustration/1901a4d3-29b0-0f07-26d7-94d849f3d883/?size=48
https://library.kiwix.org/catalog/v2/illustration/2e9bcc9f-420a-fa75-73cd-c322d445c089/?size=48
https://library.kiwix.org/catalog/v2/illustration/40dcb30d-56c3-238c-d1b2-6d7d89d929bc/?size=48
https://library.kiwix.org/catalog/v2/illustration/7d493deb-2f5c-8f0a-56e1-43d66e418238/?size=48
https://library.kiwix.org/catalog/v2/illustration/cc525677-62fb-554e-5f94-0574126baf03/?size=48
https://library.kiwix.org/catalog/v2/illustration/5798dc0f-b0e6-da75-53d9-d991cd6933ff/?size=48

each of those can be opened in browser (or otherwise), and the HTTP response is 200.

@veloman-yunkan veloman-yunkan linked a pull request Feb 24, 2025 that will close this issue
@veloman-yunkan
Copy link
Collaborator

The problem was that our build of libcurl didn't support HTTPS protocol. A fix (or, at least, part of it) is in kiwix/kiwix-build#807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants