notion-py
notion-py copied to clipboard
Not documented: how to set the size of an image
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.
Thank you!