getImageInfo static method
Get image information of image object img
.
Implementation
static Future<ImageObject> getImageInfo(ImageObject img) async {
// Get image width/height
if (img.modifiedWidth == null || img.modifiedHeight == null) {
final bytes = await File(img.modifiedPath).readAsBytes();
final decodedImg = decodeImage(bytes)!;
img.modifiedWidth = decodedImg.width;
img.modifiedHeight = decodedImg.height;
}
return img;
}