[QUESTION] Resize image before adding it as base64
Question
I'm currently adding images to the canvas as base64 (embedAsBase64: true). I don't want to upload the image for the moment, to keep things simple. But, I want to be able to resize or crop the image before adding it through the asset manager as base64, to avoid oversized images added by the user.
Basically I would need an event before the image is added, so I can transform the image, but for now we only have access to asset:add event. Any ideas if this would be possible ?
Thanks
Answers (2)
Well, obviously you can't resize and crop without having all the image data at first. So, on asset:add event propose your "crop and resize" solution and then update the asset with the new data
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #861
[Question] Help adding images to the canvas
I've followed the docs and have been able to upload images. When I drag an image block (using the newsletter preset) and select an image fr...
Issue #1581
[Question] AssetManager not shown uploaded images
Hi all, I'm using grapesjs - 0.14.33. I have successfull implemented StorageManager in remote mode, I can load and store data. I have succe...
Issue #1988
bug on resize image
Hi ! I have some issues when i want resize an image. When i put an image and when i click one resizer handler, the image don't keep his hei...
Issue #401
Cannot upload images
Hi, while uploading an image through asset manager, I get the following error: Assetmanager configuration at editor init looks like Folder...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.