Compressor
Compressor copied to clipboard
An android image compression library.
`Fatal Exception: java.lang.IllegalStateException: this must not be null at id.zelory.compressor.UtilKt.loadBitmap(Util.kt:34) at id.zelory.compressor.constraint.QualityConstraint.satisfy(QualityConstraint.kt:21) at id.zelory.compressor.Compressor$compress$3.invokeSuspend(Compressor.kt:28) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) ` any idea why?
`Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface. java.io.IOException: Invalid byte order: 5249`
Make a code for java too. Also add the compressed image into URI. so we can get its path and upload to databases.
/storage/emulated/0/Android/data/com.app/files/Pictures/file.jpg: The source file doesn't exist.
Compress Large Image Size Crash My Application
I have a big png image, my code is : ```kotlin Compressor.compress(App.instance, file) { destination( File( cacheImageDir, compressedFileName ) ) size(1024 * 1024 * 10) } ``` The result is...
Compressor has private access
Implementation: ``` val originalPhotoFile = File(originalPhotoPath ?: return) lifecycleScope.launch { val compressedPhotoPath = Compressor.compress(requireContext(),originalPhotoFile) } ``` Exception: ``` Fatal Exception: java.lang.IllegalStateException: BitmapFactory.decodeFile…eFile.absolutePath, this) must not be null at id.zelory.compressor.UtilKt.decodeSampledBitmapFromFile(Util.kt:45) at...
I set the format as PNG and size constraint to 1 MB but the result I'm getting is larger than the specified size. Actual Image size -> 4 MB Size...
When I try to capture an image using the camera then compressing it using this SDK I get the image in landscape mode instead of portrait mode