Skip to content

Add utility to fetch and prepare ZIM illustration ; make this utility directly accessible from illustration metadata #260

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benoit74
Copy link
Collaborator

Fix #254

Nota : code has been adapted from libretexts/warc2zim version to also optimize the image, hence fixing the issue found recently (openzim/warc2zim#448)

@benoit74 benoit74 self-assigned this Apr 29, 2025
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fef63f8) to head (dab6ba2).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #260   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           39        40    +1     
  Lines         2455      2484   +29     
  Branches       331       335    +4     
=========================================
+ Hits          2455      2484   +29     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74 benoit74 marked this pull request as ready for review April 29, 2025 12:17
@benoit74 benoit74 requested a review from rgaudin April 29, 2025 12:17
@benoit74 benoit74 force-pushed the process-illustration branch from d23a061 to d597620 Compare April 29, 2025 12:32
@benoit74 benoit74 force-pushed the fix_js_import_rewrite branch from 788e4ae to baad1c3 Compare April 29, 2025 13:15
… directly accessible from illustration metadata
@benoit74 benoit74 force-pushed the process-illustration branch from d597620 to dab6ba2 Compare April 29, 2025 13:18
@benoit74 benoit74 changed the base branch from fix_js_import_rewrite to main April 29, 2025 13:19
@benoit74
Copy link
Collaborator Author

Rebased on main for simplicity of review

Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Thank you it's great.

I would have preferred not to extend the Illustration Metadata constructor. That seems unnecessary and it shifts the (unwritten) spirit of that API towards a more logic-intensive approach than I expected it to be.

I like that it's designed to receive proper values with safety-net-like checks that prevents breaking our convention. Sending inappropriate data and store a transformed version feels off to me.

Parsing, downloading, converting, optimizing, it's a lot. I expect shit to happen and I find cleaner to do that as a separate step then put the successful result into the metadata.

Let me know what you think

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.

Add utility function to automatically retrieve and resize illustrations
2 participants