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

perf(file): Compress bit more aggressively #21899

Merged

Conversation

surajshetty3416
Copy link
Member

@surajshetty3416 surajshetty3416 commented Aug 2, 2023

Current "Optimize" is quite ineffective and hardly reduces the size of the image. Websites continue to load big images causing slow page loads.

Proposal is to reduce the default "max_resolution" and to atleast reduce the resolution to 80% to maximise the saving.

This should be fine since users explicitly click on optimise and their primary reason for it is to reduce file size. Assuming that they are fine with minor quality degrade.

I tried compressing a image file of size 1.41M
Optimised file size: 1.36M (before this fix)
Optimised file size: 461.3K (with this fix)

Other:

  • Now system will display formatted file size on setting "File Size" in "Options" of Int field.
    Before:
    Screenshot 2023-08-02 at 11 01 52 AM
    After:
    Screenshot 2023-08-02 at 11 02 13 AM

@surajshetty3416 surajshetty3416 requested review from a team and maharshivpatel and removed request for a team August 2, 2023 05:03
@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Aug 2, 2023
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #21899 (67a32bd) into develop (6645589) will decrease coverage by 0.01%.
Report is 260 commits behind head on develop.
The diff coverage is 20.83%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21899      +/-   ##
===========================================
- Coverage    61.66%   61.65%   -0.01%     
===========================================
  Files          765      765              
  Lines        72977    72987      +10     
  Branches      6292     6292              
===========================================
  Hits         45002    45002              
- Misses       24368    24381      +13     
+ Partials      3607     3604       -3     
Flag Coverage Δ
server 65.24% <18.53%> (+<0.01%) ⬆️
server-ui 28.09% <8.28%> (-0.01%) ⬇️
ui-tests 51.26% <60.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@surajshetty3416 surajshetty3416 merged commit 0b5a24b into frappe:develop Aug 2, 2023
20 of 22 checks passed
@surajshetty3416 surajshetty3416 deleted the fix-image-compression branch August 2, 2023 05:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
add-test-cases Add test case to validate fix or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant