Open anandshivam44 opened 3 years ago
I think the only way for now is to save the bitmap to a file first, then that file will be passed to the compressor
For example
withContext(Dispatchers.IO) {
val tempImageFile = File(context.cacheDir, System.currentTimeMillis().toString());
saveBitmap(image, tempImageFile)
val compressedImageFile = Compressor.compress(context, tempImageFile)
}
I am working with java and kotlin I have the image as Bitmap How can I pass image to Compressor.compress(context,filepath) It accepts only File type