Replies: 2 comments
-
|
This is my current implementation of the component in react. Any idea @fengyuanchen @shekhar-shubhendu ? <Cropper
style={{ height: 500, width: "100%" }}
modal={true}
aspectRatio={1}
src={cropperEditorImage}
minCropBoxHeight={100}
minCropBoxWidth={100}
background={true}
responsive={true}
checkOrientation={false}
guides={false}
center={false}
viewMode={0}
autoCropArea={1}
onInitialized={(instance) => {
setCropper(instance);
}}
ready={(image) => {
}}
zoom={(e) => {
if (e.detail.ratio < 0.05) {
e.preventDefault();
}
}}
/> |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Reference this example: https://fengyuanchen.github.io/cropperjs/v1/examples/responsive-container.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing the component in React. When the image loads, it always scales to the height of the cropper and doesn't retain its original dimensions. If the image is too small, it makes it larger, and if it's too large, it makes it smaller until it fits the container.
I've already tried using viewMode=0, but it still has the same behavior.
I require the image to load at its original height and width, regardless of whether it exceeds the cropper's limits as I show in the attached images:
Beta Was this translation helpful? Give feedback.
All reactions