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

It's not working good if you limit with width and height #19

Open
Xstyler85 opened this issue Aug 27, 2021 · 4 comments
Open

It's not working good if you limit with width and height #19

Xstyler85 opened this issue Aug 27, 2021 · 4 comments

Comments

@Xstyler85
Copy link

I limited Cropper with parent element and now it's now working good anymore.
Image doesn't have minimum height of 100%

https://svelte.dev/repl/199bba8d1c4543e7a98f9fb764f24a60?version=3.4.4

Is this even possible?

@ValentinH
Copy link
Owner

You should try using the aspect prop instead of the cropSize one.

@Xstyler85
Copy link
Author

I tried, but it doesn't solve the problem. I also tried to customize it, but unfortunatley I'm not that good.
I would like to achive this on inital load despite the image size or aspec ratio, without the transparent gray area.
image

@ValentinH
Copy link
Owner

I think that what you need could be handled by an objectFit property like it was added on the React version: ValentinH/react-easy-crop#236

If you are interested, this could be a nice addition to this library and I would be happy to review a PR for it.

@oscarhermoso
Copy link
Contributor

@Xstyler85 Kinda hacky, but you could put the cropper into a wrapping div like this:

https://svelte.dev/repl/cee0976190214fb3adee3c3ba30f72c3?version=3.4.4

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

3 participants