computeResourcePages static method
Implementation
static Future<int> computeResourcePages(
Publication publication, Link link) async {
MediaType mediaType = link.mediaType;
if (mediaType.isBitmap || mediaType == MediaType.pdf) {
return 1;
}
int length = (await publication.fetcher.get(link).length())
.getOrElse((failure) => 0);
int res = (length / _pageSize).ceil();
return res;
}