From 18ec311863fef70f5e372b0321b0b516a680d436 Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Wed, 10 Dec 2025 22:08:42 +0900 Subject: [PATCH] refactor: Fix code --- lib/platform_image_converter.dart | 4 ++-- lib/src/android/native.dart | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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.', ),