-
Notifications
You must be signed in to change notification settings - Fork 5
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(canvas): Add "maxCanvasSize" option for canvas #174
Conversation
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.
size-limit report 📦
|
const resizedBitmap = | ||
targetWidth === width && targetHeight === height | ||
? bitmap | ||
: // resize bitmap to fit within maxsize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if this is not supported? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure tbh, it could throw or it could ignore the options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My previous commit did the resizing manually with drawImage()
, but I'd rather use the builtin since it's pretty well-supported. I think throwing and not capturing exceptions and in the other case, if it doesn't throw and just ignores the options and captures the original size, are both acceptable outcomes.
I'm going to merge as-is, but let me know what you think and I can follow-up.
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498 Backport of #11617
We do not want to allow users to capture super large canvases, enforce a max size limit Requires getsentry/rrweb#174 Closes #10498 Backport of #11617
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.
This adds a configuration option to set a max size for canvas snapshots. This will scale down canvas snapshot images if they are larger than the configure size limit. The size configuration is width * height.