Image Compressor Library
1
Dependancy:
id.zelory:compressor:1.0.4
Import:
java.io.File
On File Picked :
File file = new File(path);
File compressedImage = new Compressor.Builder(this)
.setCompressFormat(Bitmap.CompressFormat.WEBP)
.setDestinationDirectoryPath(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES).getAbsolutePath())
.build()
.compressToFile(file);
imageview1.setImageBitmap(BitmapFactory.decodeFile(compressedImage.getAbsolutePath()));
For custom compression:
.setMaxWidth(640)
.setMaxHeight(480)
.setQuality(75)
1. ERROR in /storage/emulated/0/.sketchware/mysc/1610/app/src/main/java/com/wanzz/faith/compressor/ImageCompressorActivity.java (at line 194)
File compressedImage = new Compressor.Builder(this)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor Compressor.Builder(new Runnable(){}) is undefined
----------
1 problem (1 error)
how to fix this problem bro ??