Skip to content

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

Open
@konahart

Description

@konahart

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions