diff --git a/lib/platform_image_converter.dart b/lib/platform_image_converter.dart index 85a62db..731abf2 100644 --- a/lib/platform_image_converter.dart +++ b/lib/platform_image_converter.dart @@ -64,9 +64,9 @@ class ImageConverter { OutputFormat format = OutputFormat.jpeg, int quality = 100, bool runInIsolate = true, - }) { + }) async { if (runInIsolate) { - return compute( + return await compute( _convertInIsolate, _ConvertRequest(inputData, format, quality, defaultTargetPlatform), ); diff --git a/lib/src/android/native.dart b/lib/src/android/native.dart index ccdf7dc..37c6b29 100644 --- a/lib/src/android/native.dart +++ b/lib/src/android/native.dart @@ -51,7 +51,8 @@ final class ImageConverterAndroid implements ImageConverterPlatform { compressFormat = switch (format) { OutputFormat.jpeg => Bitmap$CompressFormat.JPEG, OutputFormat.png => Bitmap$CompressFormat.PNG, - OutputFormat.webp => Bitmap$CompressFormat.WEBP_LOSSY, + // TODO: WebP is deprecated since Android 10, consider using WebP_LOSSY or WebP_LOSSLESS + OutputFormat.webp => Bitmap$CompressFormat.WEBP, OutputFormat.heic => throw UnsupportedError( 'HEIC output format is not supported on Android.', ),