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

Always resize too big images #109

Merged
merged 3 commits into from
Dec 6, 2024
Merged

Always resize too big images #109

merged 3 commits into from
Dec 6, 2024

Conversation

benoit74
Copy link
Contributor

Fix #90

Changes:

  • always resize images using more pixels than HD (1280*720 pixels) so that conversion to webp and optimization does not consumes too much memory ; side-effect : limit final ZIM size
    • 1280*720 pixels has been chosen as a viable default because it still allows pretty neat pictures even when viewed full screen on most devices (we have some big photos sometimes in libretexts.org) ... but we will probably need to check this in the wild
  • fix some un-needed code 🤦🏻‍♂️

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 49.27%. Comparing base (31b0fcb) to head (cf87e36).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
scraper/src/mindtouch2zim/asset.py 25.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   49.23%   49.27%   +0.04%     
==========================================
  Files          20       20              
  Lines        1170     1175       +5     
  Branches      164      165       +1     
==========================================
+ Hits          576      579       +3     
- Misses        583      585       +2     
  Partials       11       11              

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

@benoit74 benoit74 marked this pull request as ready for review November 29, 2024 12:40
@benoit74 benoit74 requested a review from rgaudin November 29, 2024 12:41
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.

LGTM ; see simplification suggestion

@rgaudin
Copy link
Member

rgaudin commented Nov 29, 2024

Can you rename PR?

@benoit74 benoit74 force-pushed the ui_enhancements branch 2 times, most recently from fcf14bb to 82c30f0 Compare December 6, 2024 14:33
Base automatically changed from ui_enhancements to main December 6, 2024 14:35
@benoit74 benoit74 changed the title Put memory consumption under control Always resize too big images Dec 6, 2024
@benoit74 benoit74 merged commit 36618e5 into main Dec 6, 2024
10 checks passed
@benoit74 benoit74 deleted the fix_memory branch December 6, 2024 14:50
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.

Out of memory issue - Docker 137 exit code
2 participants