Skip to content

Possible to make crop area always fill crop container ? #610

@rudokotrla

Description

@rudokotrla

Hello, first of all thanks for creating and maintaining this library!

I have a question whether my use case is supported.
I have a cropper with given aspect ratio and basically everything works when media size is at least the size of the cropper container. However, when the media size is small the crop area "adapts" to the smaller dimmensions of the media, shrinking the its area.

For illustration, this happens when media size is smaller than cropper container:

Image

Instead, I like to have this (used bigger size media in this case):

Image

Is there a way to make the crop area always fit to the maximum of the cropper container ?

EDIT: Also noticed that object fit affects this behaviour. On top of my original answer I also need the "initial" object fit or zoom set up so that media is fully contained in the cropper area. So on initial media load it should look like this:
Image

Thanks for your tips!

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