convertToBytes method
Converts a HEIC/HEIF file at inputPath to PNG bytes in memory.
Implementation
@override
Future<Uint8List> convertToBytes(
String inputPath, {
int compressionLevel = 6,
bool preserveMetadata = true,
}) async {
final result =
await methodChannel.invokeMethod<Uint8List>('convertToBytes', {
'inputPath': inputPath,
'compressionLevel': compressionLevel.clamp(0, 9),
'preserveMetadata': preserveMetadata,
});
if (result == null) {
throw PlatformException(
code: 'conversion_failed',
message: 'Platform returned null result',
);
}
return result;
}