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

[zimwriterfs] Use the correct method to add the illustration to zim file. #356

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

mgautierfr
Copy link
Collaborator

Fix #355

@mgautierfr
Copy link
Collaborator Author

I have keep the current metadata array as we run a check on them and drop Illustration_48x48@1 from it make the check failing.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03% ⚠️

Comparison is base (06e43a0) 27.55% compared to head (2d14520) 27.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #356      +/-   ##
==========================================
- Coverage   27.55%   27.52%   -0.03%     
==========================================
  Files          26       26              
  Lines        2519     2521       +2     
  Branches     1344     1346       +2     
==========================================
  Hits          694      694              
- Misses       1354     1356       +2     
  Partials      471      471              
Files Changed Coverage Δ
src/zimwriterfs/zimwriterfs.cpp 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +126 to +128
if (kv.first == "Illustration_48x48@1") {
zimCreator.addIllustration(48, kv.second);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will take slightly more effort, but while we are at it, why not fix this issue for all illustrations of the NxN@1 kind?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well.. it is two different issues :)

Supporting NxN@1 is not just parse the "Illustration_NxN@1" string. This string is already fixed and is added by https://github.com/openzim/zim-tools/blob/main/src/zimwriterfs/zimwriterfs.cpp#L100-L103

We will have to extend the zimwriterfs options to allow user to pass other illustration other than 48x48 first (and if we do this, probably not pass through the Metadata class (or extend it to store the size as plain value)).

I not really sure we should do this in this PR which "simply" set the correct mimetype for illustration.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hack creates a situation where the same bug is likely to be reintroduced for illustrations with dimensions different from 48x48 when zimwriterfs is enhanced to support them. One way to track it is to add an action item (with a checkbox) to the corresponding ticket (or create such a ticket if one doesn't yet exist).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no such ticket ATM and given:

  • we don't quite support other sizes (no reader makes use of them at least)
  • we don't use zimwriterfs anymore ourselves for creating ZIM files
    I'd say it's safe to merge as-is.

@mgautierfr
Copy link
Collaborator Author

Packages CI is failing because of #362 merged a bit too soon.

I'm merging this PR as we seem to agree (at least, not counter argument since a month).
Issue #364 opened to follow the discussion.

@mgautierfr mgautierfr merged commit 82109ba into main Jul 28, 2023
9 of 13 checks passed
@mgautierfr mgautierfr deleted the fix_illustration_mimetype branch July 28, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zimwriterfs create zim file with compressed illustration (wrong mimetype)
3 participants