getImageExifInfoByBuffer static method
Implementation
static Future<ImageExifInfo?> getImageExifInfoByBuffer({
required Uint8List fileBuffer,
}) async {
if (kIsWeb) {
return null;
}
final data = await readExifFromBytes(fileBuffer);
String? owidth = data["EXIF ExifImageWidth"]?.printable;
String? oheight = data["EXIF ExifImageLength"]?.printable;
bool isRotate = false;
String rotate = data["Image Orientation"]?.printable ?? "";
if (owidth != null && owidth != '0' && oheight != null && oheight != '0') {
if (rotate.contains("90") || rotate.contains("270")) {
isRotate = true;
}
if (isRotate) {
(owidth, oheight) = (oheight, owidth);
}
return ImageExifInfo(height: double.parse(oheight), width: double.parse(owidth), isRotate: isRotate);
}
return null;
}