From 059c81942960ce342ca6f121ad7795a18aaf657e Mon Sep 17 00:00:00 2001 From: nilsreichardt Date: Sun, 6 Aug 2023 20:14:55 +0200 Subject: [PATCH] Skip image compressing for macOS --- .../implementation/mobile_native_image_compressor.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/filesharing/files_usecases/lib/src/file_compression/implementation/mobile_native_image_compressor.dart b/lib/filesharing/files_usecases/lib/src/file_compression/implementation/mobile_native_image_compressor.dart index d30e4c2a1..694695dca 100644 --- a/lib/filesharing/files_usecases/lib/src/file_compression/implementation/mobile_native_image_compressor.dart +++ b/lib/filesharing/files_usecases/lib/src/file_compression/implementation/mobile_native_image_compressor.dart @@ -11,11 +11,19 @@ import 'package:files_basics/local_file.dart'; import 'package:files_basics/local_file_io.dart'; import 'package:path_provider/path_provider.dart'; import 'package:flutter_image_compress/flutter_image_compress.dart'; +import 'package:sharezone_utils/platform.dart'; import '../image_compressor.dart'; class FlutterNativeImageCompressor extends ImageCompressor { @override Future compressImage(LocalFile file) async { + if (PlatformCheck.isMacOS) { + // Currently, the image compressor does not work on macOS. + // + // https://github.com/fluttercandies/flutter_image_compress/issues/255 + return file; + } + final File ioFile = file.getFile(); final dir = await getTemporaryDirectory(); final targetPath = "${dir.absolute.path}/compressed-${file.getName()}";