Skip to content

Support setting object-fit for generated image output #356

@tuzhichang

Description

@tuzhichang

We’re currently using snapdom to capture full pages or specific DOM regions and export them as png / jpg / svg. One feature we found missing (and would be very useful in real-world layouts) is the ability to control the object-fit behavior of the generated image.

Describe the solution you'd like
It would be great if snapdom could support configuring object-fit for the output image, for example by:

Allowing an objectFit option in the API, e.g.:

snapdom.toJpg(element, {
  objectFit: 'cover',
  width: 400,
  height: 300
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions