Size of image #5629
Answered
by
bgrand-ch
jaspreet-singh-1999
asked this question in
Q&A
Size of image
#5629
-
How to get size of image in the editor ? |
Beta Was this translation helpful? Give feedback.
Answered by
bgrand-ch
Jan 18, 2024
Replies: 1 comment
-
Hello, // https://grapesjs.com/docs/api/component.html#getel
const imageElement = imageComponent.getEl()
// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
const { width: imageWidth, height: imageHeight } = imageElement.getBoundingClientRect()
console.log('imageDimensions', {
imageWidth,
imageHeight
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jaspreet-singh-1999
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,