Compressor icon indicating copy to clipboard operation
Compressor copied to clipboard

How to compress to less than 1 MB ?

Open chihung93 opened this issue 7 years ago • 4 comments

How can I compress images under xx MB?

chihung93 avatar Mar 23 '18 04:03 chihung93

you can get file size after compress finished . if file size greater than xxMB, you can compress again.

shineqstm avatar Apr 28 '18 05:04 shineqstm

I think we should have a function that is the size of the image.

chihung93 avatar May 03 '18 08:05 chihung93

you can get file size after compress finished . if file size greater than xxMB, you can compress again.

modify maxHeight and maxWidth?

pengnix avatar Jul 17 '20 01:07 pengnix

you can get file size after compress finished . if file size greater than xxMB, you can compress again.

modify maxHeight and maxWidth?

You can use this method to get the file size: `
public static String getAutoFileOrFilesSize(String filePath) {

    File file = new File(filePath);

    long blockSize = 0;

    try {

        if (file.isDirectory()) {

            blockSize = getFileSizes(file);

        } else {

            blockSize = getFileSize(file);

        }

    } catch (Exception e) {

        e.printStackTrace();

    }

    return FormetFileSize(blockSize);

}

`

shineqstm avatar Jul 17 '20 01:07 shineqstm