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

[form-builder] Constrain rendered images to a reasonable size #1330

Merged
merged 2 commits into from
May 23, 2019

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented May 23, 2019

The image input renders the full-size image, which can be quite expensive in terms of both bandwidth and CPU/memory usage.

While the optimal thing to do may be to constrain it to the size of the container, that can quickly yield a myriad of different variations based on the client. Instead, we constrain it to the max size that the image tool (the crop/hotspot editor) will use, currently 1000px in width. We also factor in the DPR, scaling it up if the device supports it.

It's a bit convoluted, but I think this is the best I can come up with within a reasonable timeframe. Better than 20 MB jpegs, I guess? ;)

@rexxars rexxars changed the title Image input constrain size [form-builder] Constrain rendered images to a reasonable size May 23, 2019
Copy link
Contributor

@kristofferjs kristofferjs left a comment

Choose a reason for hiding this comment

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

LGTM

@rexxars rexxars merged commit 6d04113 into next May 23, 2019
@rexxars rexxars deleted the image-input-constrain-size branch May 23, 2019 14:42
bjoerge pushed a commit that referenced this pull request Aug 13, 2019
* [imagetool] Expose max height / max width used in image tool

* [form-builder] Constrain rendered images to a reasonable size
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.

None yet

2 participants