You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently tried to crop images of various types(png, jpeg, svg) using react-image-crop and was able to sucessfully do it for jpeg and png types. For svg type though, I'm not able to get the image to scale down properly.
Note: My requirement needs a restricted container for cropping and viewing the preview image.
Attaching the code sandbox that was forked to test it : https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-forked-v0h7lq?file=/src/canvasPreview.ts
In the code above, the scaling method for canvas is a little different, it scales based in the objectFit: 'contain' height and width.
Sample svg file:
Cropped image example:
The text was updated successfully, but these errors were encountered:
Hello,
I recently tried to crop images of various types(png, jpeg, svg) using react-image-crop and was able to sucessfully do it for jpeg and png types. For svg type though, I'm not able to get the image to scale down properly.
Note: My requirement needs a restricted container for cropping and viewing the preview image.
Attaching the code sandbox that was forked to test it :
https://codesandbox.io/s/react-image-crop-demo-with-react-hooks-forked-v0h7lq?file=/src/canvasPreview.ts
In the code above, the scaling method for canvas is a little different, it scales based in the objectFit: 'contain' height and width.
Sample svg file:
Cropped image example:
The text was updated successfully, but these errors were encountered: