Closed fung-leung closed 3 years ago
version 3.14.1
I upload a 4k images, 5.5mb
after upload, it become 13.6mb
I am using code below:
<ImgCrop aspect={1} quality={1} rotate> <Upload name="file" accept=".jpg,.png,.jpeg" listType="picture-card" className="avatar-uploader" showUploadList={false} directory={false} multiple={false} beforeUpload={beforeUpload} customRequest={({ file, onError }) => { setLogoLoading(true); mediaUpload(mediaDir.eventPic, file as RcFile) .then(handleUploadSuccess) .catch(onError); }} > {logoUrl ? ( <img src={logoUrl} alt="pic" style={{ width: '100%' }} /> ) : ( logoUploadButton )} </Upload> </ImgCrop>
FYI, I didn't crop or rotate it. Here is the source image.
Yes, it's a predictable change.
You can try reducing the quality prop to find the right size.
quality
version 3.14.1
I upload a 4k images, 5.5mb
after upload, it become 13.6mb
I am using code below: