-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
I have keep the current metadata array as we run a check on them and drop |
Codecov ReportPatch coverage has no change and project coverage change:
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
☔ View full report in Codecov by Sentry. |
if (kv.first == "Illustration_48x48@1") { | ||
zimCreator.addIllustration(48, kv.second); | ||
} else { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
1b39c5d
to
2d14520
Compare
Fix #355