readFile static method
Implementation
static Future<AssetItem?> readFile(String path, Lib lib, SharedOptions options) async {
final AssetItem? asset = await AssetItem.readFile(path, lib, options);
if (asset != null) {
final Image? img = decodeImage(asset.content!);
return img == null
? asset
: ImageAssetItem(
path: asset.path,
name: asset.name,
hash: asset.hash,
lib: asset.lib,
options: asset.options,
content: asset.content,
width: img.width,
height: img.height,
);
} else {
return null;
}
}