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

Not documented: how to set the size of an image #372

Open
konahart opened this issue May 22, 2022 · 1 comment
Open

Not documented: how to set the size of an image #372

konahart opened this issue May 22, 2022 · 1 comment

Comments

@konahart
Copy link

By default, ImageBlocks take up the entire width of the page. If you have a small image, this can look terrible.

You can set the dimensions of an image by setting its width, like so:

image_block = row.children.add_new(ImageBlock)
image_block.width = 250

Notion will automatically scale the height to keep the aspect ratio.

Be sure to set the size after uploading an image:

image_block = row.children.add_new(ImageBlock)
image_block.upload_file(f)
image_block.width = 250

Mostly making an issue because I couldn't find the information in this repo. Hopefully this helps someone else.

@wherewith
Copy link

Thank you!

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

No branches or pull requests

2 participants