fix(export): prevent crashes during export size validation - #4326
Merged
Conversation
Member
Author
|
Could you review the changes after the refactoring you did for the export modal? I think everything is working well now. |
Switching to Advanced mode could crash the app, clearing a size field could break the aspect ratio, and oversized exports failed silently with a cryptic error. - Fix crash when applying default values in Advanced mode - Do not reset empty/invalid fields to 1 - Validate against the final rendered pixel size, not the raw input values, and reject sizes the browser can't handle: less than 1 px per side, more than 32,767 px per side, or more than 268,435,456 px total - Fix broken size validation logic - Show clear error messages in the export dialog
hamed-musallam
force-pushed
the
fix-export-dialog
branch
from
August 25, 2026 11:09
ad3a5d2 to
f8cb019
Compare
Deploying nmrium with
|
| Latest commit: |
79b0d69
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://57b59fe4.nmrium.pages.dev |
| Branch Preview URL: | https://fix-export-dialog.nmrium.pages.dev |
tpoisseau
approved these changes
Aug 25, 2026
tpoisseau
left a comment
Contributor
There was a problem hiding this comment.
I'm not sure to prefer min={0} over min={1}
Otherwise, LGTM
Sebastien-Ahkrin
approved these changes
Aug 25, 2026
Sebastien-Ahkrin
left a comment
Collaborator
There was a problem hiding this comment.
LGTM Thanks you !
Member
Author
I think a minimum value of 1 is required for values in pixels, but for other units, we could allow values greater than 0. |
Contributor
Ok, I have no strong opinion on this topic and I approved. Do what you think is better ;-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching to Advanced mode could crash the app, clearing a size field could break the aspect ratio, and oversized exports failed silently with a cryptic error.