encodeJpgFile function
Future<bool>
encodeJpgFile(
- String path,
- Image image, {
- int quality = 100,
- JpegChroma chroma = JpegChroma.yuv444,
Encode an image
to a JPG file at the given path
.
Implementation
Future<bool> encodeJpgFile(
String path,
Image image, {
int quality = 100,
JpegChroma chroma = JpegChroma.yuv444,
}) async {
if (!supportsFileAccess()) {
return false;
}
final bytes = JpegEncoder(quality: quality).encode(image, chroma: chroma);
return writeFile(path, bytes);
}