convertImageToJpg function
to the JPEG format.
Implementation
Future<Uint8List?> convertImageToJpg({
required File inputFile,
int quality = 100,
JpegChroma chroma = JpegChroma.yuv444,
}) async {
final imageBytes = inputFile.readAsBytesSync();
final image = decodeImage(imageBytes);
if (image == null) {
logDebug('covert image to jpg failed');
return null;
}
final jpgBytes = encodeJpg(image);
return jpgBytes;
}