convertHeicToJpeg method
Implementation
@override
Future<File> convertHeicToJpeg(File file) async {
try {
final response = await html.window.fetch(file.path);
final blob = await response.blob();
final isHeic =
blob.type.toLowerCase().contains('heic') ||
blob.type.toLowerCase().contains('heif') ||
file.path.toLowerCase().contains('.heic') ||
file.path.toLowerCase().contains('.heif');
if (!isHeic) {
return file;
}
final convertedBlob = await _convertHeicBlob(blob);
final objectUrl = html.Url.createObjectUrlFromBlob(convertedBlob);
return File(objectUrl);
} catch (e) {
print('[FlutterImageConversion] Web conversion failed: $e');
return file;
}
}