Issue #1809πŸ’¬ AnsweredOpened February 19, 2019by sakshigarg91 reactions

Customize image resizing

Quick answerby artf❀ 1

How can I update these properties if I'm using the grapesjs-preset-webpage? You can always update a component type (but do it as a plugin)

Read full answer below ↓

Question

If i want to limit resizing an image to only specific dimensions, how can i do that? Also is it possible to enable resizing only from the bottom right corner and disable from the other corners and points?

Answers (3)

artfβ€’ March 3, 2019

How can I update these properties if I'm using the grapesjs-preset-webpage?

You can always update a component type (but do it as a plugin)

editor.DomComponents.addType('image', {
	model: {
		defaults: {
			resizable: {
				  tl: 0, // Top left
                  tc: 0, // Top center
                  tr: 0, // Top right
                  cl: 0, // Center left
                  bl: 0, // Bottom left
			}
		}
	}
})
artfβ€’ February 22, 2019

You can use this options for the resizable property of components

sakshigarg9β€’ February 26, 2019

How can I update these properties if I'm using the grapesjs-preset-webpage?

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.