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

Put memory consumption under control #109

Open
wants to merge 3 commits into
base: ui_enhancements
Choose a base branch
from
Open

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 🤦🏻‍♂️

@benoit74 benoit74 self-assigned this Nov 29, 2024
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 44.26%. Comparing base (d802fef) to head (e0b8b01).

Files with missing lines Patch % Lines
scraper/src/mindtouch2zim/asset.py 25.00% 6 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           ui_enhancements     #109      +/-   ##
===================================================
+ Coverage            44.19%   44.26%   +0.06%     
===================================================
  Files                   20       20              
  Lines                 1163     1168       +5     
  Branches               168      169       +1     
===================================================
+ Hits                   514      517       +3     
- Misses                 637      639       +2     
  Partials                12       12              

☔ 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
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

image,
[
int(
math.sqrt(
Copy link
Member

Choose a reason for hiding this comment

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

Why using this? There are resize options that keep aspect ratio and you just pass the largest one (so the other one fits)

@rgaudin
Copy link
Member

rgaudin commented Nov 29, 2024

Can you rename PR?

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.

2 participants