Issue #1721πŸ’¬ AnsweredOpened January 9, 2019by ThunderDev11 reactions

Resize image before adding it as base64

Quick answerby artf❀ 1

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

Read full answer below ↓

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)

artfβ€’ January 14, 2019

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

lock[bot]β€’ January 15, 2020

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.