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