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

fix(upload): Fix total documents size limit calculation #7843

Open
wants to merge 1 commit into
base: release-v1.6.0
Choose a base branch
from

Conversation

nifaliana
Copy link

This is a fix for the issue #7840 : Incorrect File Size Calculation During Upload for Compressed Files in Birth Registration

Comment on lines +225 to +229
const resizedImage =
Boolean(options.maxSizeMB) &&
bytesToMB(uploadedImage.size) > options.maxSizeMB &&
(await imageCompression(uploadedImage, options))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for your contribution! @nifaliana 🙏🏼
I think your approach is correct, I wonder if there is any alternative other than compressing image second time to obtain the file size. One way could be utilizing the output of the processImage function with a small refactor. What do you think?

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