getImageByHash method
Implementation
Future<ImageData?> getImageByHash(String hash,
{bool compressed = false}) async {
if (compressed) {
final img = await readImage(OP.convertToCompressedHashName(hash),
cacheSize: compressed ? CACHESIZE : null);
if (img != null) return ImageData(img, id: hash);
}
final img = await readImage(hash, cacheSize: compressed ? CACHESIZE : null);
if (img == null) throw Exception("no img cached");
// return null;
return ImageData(img, id: hash);
}