antd-img-crop icon indicating copy to clipboard operation
antd-img-crop copied to clipboard

open crop modal with defaultFileList props

Open tomasnikl opened this issue 1 year ago • 4 comments
trafficstars

Hi,

is it possible to open a modal for cropping automatically if only one file is defined in defaultFileList?

<ImgCrop aspect={aspect}>
	<Upload.Dragger
		accept={accept}
		defaultFileList={[{
			uid: 'foo1',
			name: 'foo1.png',
			status: 'done',
			url: 'https://example.com/image.png',
			thumbUrl: 'https://example.com/image.png',
		}]}
	>
		Click/Drag to upload
	</Upload.Dragger>
</ImgCrop>

the reason is the following: I know the url of the image when I load the component and I want to crop this image

tomasnikl avatar May 03 '24 07:05 tomasnikl

I think you can directly do it like this in current version?

nanxiaobei avatar May 07 '24 04:05 nanxiaobei

hey @nanxiaobei I wanna report an issue but my time is running out. your onModalCancel is uploading the image anyway, as it should close the cropper modal only. do you know how to fix it?

RezaGhx avatar May 08 '24 12:05 RezaGhx

After popping up the cropping, drag and zoom in, then click the button to shrink it. It cannot be shrunk to 1, but can only be shrunk to 1.1. What should I do

du937935598 avatar May 09 '24 09:05 du937935598

onModalCancel will ignore the upload

nanxiaobei avatar May 11 '24 16:05 nanxiaobei