getImageReslution method

Future<FileData> getImageReslution(
  1. File file
)

This tell user about image resolution

Implementation

Future<FileData> getImageReslution(File file) async {
// Or any other way to get a File instance.
  String imageType = FileSupport().getFileType(file);
  if (imageType.toLowerCase() != "image") {
    "Images only have resolution, No other file have resolution".printerror;
    return FileData();
  }
  var decodedImage = await decodeImageFromList(file.readAsBytesSync());
  print("Image Resolution is");
  "Width ${decodedImage.width}, Height${decodedImage.height}".printinfo;
  return FileData(
      imagewidth: decodedImage.width, imageheight: decodedImage.height);
}