nanxiaobei / antd-img-crop

🗡 An image cropper for Ant Design Upload
MIT License
497 stars 156 forks source link

Size increased after upload image, but i didn't crop or rotate it #125

Closed fung-leung closed 3 years ago

fung-leung commented 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>
fung-leung commented 3 years ago

FYI, I didn't crop or rotate it. Here is the source image.

source

nanxiaobei commented 3 years ago

Yes, it's a predictable change.

You can try reducing the quality prop to find the right size.