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

Files should show how big they are #2429

Closed
taoeffect opened this issue Nov 20, 2024 · 4 comments
Closed

Files should show how big they are #2429

taoeffect opened this issue Nov 20, 2024 · 4 comments
Assignees
Labels
App:Frontend Kind:Enhancement Improvements, new features, performance upgrades, etc. Level:Starter Note:UI/UX

Comments

@taoeffect
Copy link
Member

Problem

Currently when viewing a file attachment it doesn't tell you how big the attachment is:

Screenshot 2024-11-20 at 11 53 08 AM

Solution

Display file size info (e.g. "7KB", "10MB", etc.) somewhere here:

Screenshot 2024-11-20 at 11 53 08 AM

@SebinSong
Copy link
Collaborator

NOTE to myself:
Once PR #2428 is merged, the original file sizes of images change if they are compressed. This needs to be taken into account and be worked on as another PR.

@taoeffect
Copy link
Member Author

@SebinSong The compression should happen before any file is uploaded, not afterward. Once files are uploaded their size shouldn't change... so I'm confused by your comment.

@SebinSong
Copy link
Collaborator

SebinSong commented Nov 27, 2024

@taoeffect I mean, the attachment size data should be updated accordingly... not compression itself. (Of course before uploading.)

SebinSong added a commit that referenced this issue Dec 3, 2024
SebinSong added a commit that referenced this issue Dec 3, 2024
taoeffect pushed a commit that referenced this issue Dec 3, 2024
* determine if an image needs compression or not

* implement compressImage() function

* write a function that checks if image/webp format is supported

* implement recursive compression logic in compressImage()

* optimise compression factors / some corrections on file details post compression

* update the minimum quality

* fix the typo iamge

* do not resize the image unless its physical size is too large

* attachment data in contracts needs size field

* file-size to a human readable string / display it in multiple UIs

* update according to feedback

* update maximum image dimension

* remove console.log / revert back webP format as default

* add a constant for kilo-byte

* updates for PR review

* file size update after image compression
@SebinSong
Copy link
Collaborator

closed by #2435

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App:Frontend Kind:Enhancement Improvements, new features, performance upgrades, etc. Level:Starter Note:UI/UX
Projects
None yet
Development

No branches or pull requests

2 participants