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

mask does not fully cover the image when the image to a smaller aspect ratio #581

Closed
kaidev1024 opened this issue Feb 24, 2024 · 2 comments

Comments

@kaidev1024
Copy link

kaidev1024 commented Feb 24, 2024

I tried to create a component for image cropping, part of which looks like the code below. It works fine for image cropping. But when I tried to change the image from 1:1 aspect ration to 9:16, the mask only covers the upper part with a square. The lower part is not covered as shown in the image. Is there any way to fix that? Thanks!

<>
<div>
        <ReactCrop
          crop={crop}
          onChange={func}
          circularCrop={circularCrop}
          aspect={aspectRatio}
          minWidth={MIN_DIMENSION}
          keepSelection
        >
          <img
          />
        </ReactCrop>
</div>
<input
          id="imageInput"
          type="file"
          accept="image/*"
        />
<>
Screenshot 2024-02-24 at 10 28 10 PM
@dominictobias
Copy link
Owner

Are you able to repro the issue on https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-y831o ?

@kaidev1024
Copy link
Author

it works fine with your code. I need to do some debugging on my end. Thanks!

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

2 participants