-
-
Notifications
You must be signed in to change notification settings - Fork 60
Illustration API enhancement #997
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #997 +/- ##
==========================================
- Coverage 58.15% 57.92% -0.24%
==========================================
Files 100 101 +1
Lines 5325 5407 +82
Branches 2179 2219 +40
==========================================
+ Hits 3097 3132 +35
- Misses 778 801 +23
- Partials 1450 1474 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9f3a61d
to
d5d3bfb
Compare
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.
Thank you @veloman-yunkan ; implementation LGTM ; I have some general questions though:
getIllustrationSizes
has not changed. It's a separate discussion but what's the decision on this? @kelson42 ?- I thought we'd get a public method to add/read with just the width, height and scale but we have to use a new type. That's OK.
- I find
Archive::getIllustrations()
confusing. We're only getting Illustration Info, not actual illustrations. Maybe that's in line with the rest of the libzim code base though?
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.
Besides rgaudin point, this looks good to me
Aren't we going to deprecate the old API?
I will add wrappers. Let me see how to do it best.
That's a valid point, but I found |
Indeed, it's even in the ticket. Is the deprecation doc and warning to be in a separate PR?
You are mistaking Type suffixes (which is a terrible practice) with semantic/meaningful naming. I'm just signaling that from my POV it's confusing to request illustrations and receive a struct of illustration metadata. Nothing serious though and I strongly believe that API coherence is more important than individual precision |
@rgaudin I've renamed
I didn't add any wrappers. Instead I provided an overload of |
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.
Fixup commits will need to be eliminated before the PR is merged
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.
API LGTM ; thank you and sorry for the delay.
@kelson42 Please don't merge until I get rid of the fixup commits. |
5a91b26
to
3a1b99e
Compare
The PR has been rebased. CI failures on Linux are because since kiwix/kiwix-build#834 was merged dependencies are built on jammy, while libzim CI keeps running on focal. Should be fixed by #1002. The failures on macOS have nothing to do with these changes. One of the failures is because of the following error:
The other three failures say:
|
The new unit test was copied and adapted from the Tools.parseIllustrationPathToSize unit-test.
There was an extra character in the format string of the sscanf.
Parsing of the illustration metadata item name now supports attributes too. Also, an illustration metadata item name is now considered invalid if it doesn't match the string generated from the result of the parsing (which can be, for example, due to leading zeros in width and/or height values, leading and/or trailing zeros in the scale value, wrong order of attributes, etc).
3a1b99e
to
7e8bb1a
Compare
Fixes #937