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

OPDS Icon is limited #533

Closed
rgaudin opened this issue May 11, 2021 · 14 comments · Fixed by #577
Closed

OPDS Icon is limited #533

rgaudin opened this issue May 11, 2021 · 14 comments · Fixed by #577
Assignees
Milestone

Comments

@rgaudin
Copy link
Member

rgaudin commented May 11, 2021

At the moment, most ZIM only include a Favicon metadata that is 48px squared due to the requirement in the spec and the fact that kiwix-serve has only ever displayed it.

Some ZIM don't respect it and include different resolution/form-factor.

With the ability to now use higher definition illustrations via the Illustration metadata, it's important those are used when available and pertinent. I suppose kiwix-serve might use it for its homepage redesign.

With the global switch to OPDS in readers, it's important that those higher definition images are available through OPDS, to accomodate the platform/reader needs. On a high DPI (retina) display, the 48px is blurry unless scaled down to 24px which is very small.

I have no suggestion on how that should be done. The current node reads as:

<icon>/meta?name=favicon&amp;content=gutenberg_sv_all_2021-05</icon>
@kelson42
Copy link
Collaborator

Yes, wee need to put all the illsutrations in the opds feed. @mgautierfr @veloman-yunkan doable?

@veloman-yunkan
Copy link
Collaborator

The OPDS spec (see https://specs.opds.io/opds-1.2#522-artwork-relations and examples in the spec) suggests that it could be done as follows:

<link rel="http://opds-spec.org/image/thumbnail" 
        href="/meta?name=Illustration_48x48&amp;content=gutenberg_sv_all_2021-05"
        type="image/png;width=48;height=48"/>

<link rel="http://opds-spec.org/image/thumbnail" 
        href="/meta?name=Illustration_64x64&amp;content=gutenberg_sv_all_2021-05"
        type="image/png;width=64;height=64"/>

I don't see any problem implementing this, given that libzim provides an API for enumerating available illustrations as proposed in my review comment

@kelson42 kelson42 transferred this issue from kiwix/kiwix-tools May 20, 2021
@kelson42 kelson42 added this to the 10.0.0 milestone May 20, 2021
@kelson42
Copy link
Collaborator

@veloman-yunkan We really need that to get proper fancy catalogue. Does the libzim7 delivers what is necessary to extend here the OPDS?

@kelson42
Copy link
Collaborator

@rgaudin @mgautierfr After our discussion of last week, we probably need here - as well - a pixel depth indicator?

@veloman-yunkan
Copy link
Collaborator

Does the libzim7 delivers what is necessary to extend here the OPDS?

@kelson42 Not at the moment. I proposed an enhancement earlier.

@kelson42
Copy link
Collaborator

kelson42 commented Jun 8, 2021

@veloman-yunkan This has been implmented, but still in review. Any chance to get a libkiwix PR using this new API soon?

@kelson42
Copy link
Collaborator

The code is now in libzim master.

@veloman-yunkan
Copy link
Collaborator

@kelson42 @mgautierfr In order to test the fix for this enhancement I will need a ZIM file with multiple illustration entries. How do I create one?

@kelson42
Copy link
Collaborator

kelson42 commented Jul 6, 2021

@veloman-yunkan @mgautierfr There should be already one in the https://github.com/openzim/zim-testing-suite ?! I remember we had to make a new release there before merging the Illustration related PR at openzim/libzim.

@mgautierfr
Copy link
Member

There should be already one in the openzim/zim-testing-suite

Not with several illustration entries.

How do I create one?

Clone openzim/zim-testing-suite, modify the data/scripts, regenerate the zim files, commit everything and make a PR.
There is no automated process for now.

@veloman-yunkan
Copy link
Collaborator

veloman-yunkan commented Jul 7, 2021

Clone openzim/zim-testing-suite, modify the data/scripts, regenerate the zim files, commit everything and make a PR.

@mgautierfr But is there a tool that can create a ZIM file with several illustration entries? Or a workaround?

@rgaudin
Copy link
Member Author

rgaudin commented Jul 7, 2021

just call addIllustration() multiple times with different sizes

@veloman-yunkan
Copy link
Collaborator

just call addIllustration() multiple times with different sizes

This is not acceptable as long it requires a custom build of zimwriterfs . Test data must be created in a reproducible way.

@rgaudin
Copy link
Member Author

rgaudin commented Jul 14, 2021

Hum, I think I understand what your problem is here ; please confirm:

  • libkiwix is not using the new test files repo.
  • most tests zims from this repo are not reproducible. There are present, but we don't have the source code which created them.
  • Only corner_cases.zim is reproducible (create_corner_cases_zim_file shell script)
  • corner_cases.zim is built using zimwriterfs at the moment so until zimwriterfs can write multiple Illustrations, it can't be used to create appropriate test.

You could have been a little more explicit 😅

Would it make sense to create an additional many-illustrations zim file (using libzim, not zimwriterfs) just for this use case ?

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