zetbaitsu / Compressor

An android image compression library.
7.08k stars 963 forks source link

Custom compress does not apply. #117

Open kurular4 opened 5 years ago

kurular4 commented 5 years ago

Custom compress does not apply. Tried in different emulators & real devices and different images.

Without compression;

Image size: 6.1 MB

After default compression;

Image size: 2 MB

After custom compression the way given below;

Image size: 2 MB

new Compressor(context).setQuality(50).compressToBitmap(new File(filePath.getPath()));

or

new Compressor(context) .setQuality(75) .setMaxHeight(480) .setMaxWidth(640) .setCompressFormat(Bitmap.CompressFormat.WEBP).compressToBitmap(new File(filePath.getPath()));