compressImageBytes method
Future<ImageBytesResult>
compressImageBytes(
- Uint8List source,
- ImageCompressConfig config
override
Compress bytes in memory. Images only — a video would mean copying tens of megabytes across the platform channel in one message.
Implementation
@override
Future<ImageBytesResult> compressImageBytes(
Uint8List source,
ImageCompressConfig config,
) async {
try {
return await FfmpegImage.compressBytes(source: source, config: config);
} on CompressException {
rethrow;
} catch (e) {
throw ImageCompressException(CompressErrorCode.imageCompressFailed, '$e');
}
}