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

feat: add configurable compression level for zip downloads (Folder Share page, downloadPageFolder.html) #179

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Saren-Arterius
Copy link
Contributor

@Saren-Arterius Saren-Arterius commented Jan 14, 2025

Added the ability to customize zip file compression levels:

- Added new ArozZipFileWithCompressionLevel function that accepts compression level parameter
- Added compression_level query parameter support to share downloads
- Added UI checkbox to toggle between compressed/uncompressed downloads
- Auto-detect when folder contains mostly media files (>= 50% in size) and pre-check uncompressed option
- Updated compression help text to provide guidance on media files
- Default compression level remains at flate.DefaultCompression (-1)

The changes allow users to choose no compression for media-heavy folders to improve zipping speed, while maintaining regular compression for other content types.

Screenshot From 2025-01-14 18-13-40

Case for 500 jpegs of 2.5GB in total

10-20x faster processing if uncompressed

Before (default compression zipping)

[saren@saren-gaming ~ ]% time curl 'https://AROZ/share/download/f5b58501-b363-42e1-8ae9-2c48151b8a44' > /dev/null 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2554M  100 2554M    0     0  58.9M      0  0:00:43  0:00:43 --:--:--  626M
curl  > /dev/null  0.53s user 1.68s system 5% cpu 43.322 total

After (uncompressed zipping)

[saren@saren-gaming ~ ]% time curl 'https://AROZ/share/download/f5b58501-b363-42e1-8ae9-2c48151b8a44?compression_level=0' > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2564M  100 2564M    0     0   452M      0  0:00:05  0:00:05 --:--:--  575M
curl  > /dev/null  0.58s user 1.48s system 36% cpu 5.668 total

- Display thumbnail preview when hovering over image rows
- Preview follows cursor movement with offset
- Apply hover effect on entire row for better UX
…are page, downloadPageFolder.html)

Added the ability to customize zip file compression levels:

- Added new ArozZipFileWithCompressionLevel function that accepts compression level parameter
- Added compression_level query parameter support to share downloads
- Added UI checkbox to toggle between compressed/uncompressed downloads
- Auto-detect when folder contains mostly media files (>= 50% in size) and pre-check uncompressed option
- Updated compression help text to provide guidance on media files
- Default compression level remains at flate.DefaultCompression (-1)

The changes allow users to choose no compression for media-heavy folders to improve zipping speed, while maintaining regular compression for other content types.
Copy link
Owner

@tobychui tobychui left a comment

Choose a reason for hiding this comment

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

LGTM

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