toJpegQ92 function

Uint8List? toJpegQ92(
  1. Uint8List imageBytes
)

PNG (or other) → JPEG Q92 for DCT embed, same quality as native DCT path.

Implementation

Uint8List? toJpegQ92(Uint8List imageBytes) {
  if (isJpeg(imageBytes)) return imageBytes;
  final decoded = img.decodeImage(imageBytes);
  if (decoded == null) return null;
  return Uint8List.fromList(img.encodeJpg(decoded, quality: 92));
}