Description of problem
Before 9.0.0, Image and ImageResolver were separate. If you only had an image hash, you could resolve the image URL by passing the hash to ImageResolver:
let imageURI = await hitomi.ImageResolver.getImageUri({
hash: hash,
hasAvif: true,
hasWebp: true,
hasJxl: false,
}, "avif");
Since 9.0.0, ImageResolver has been merged into Image. URLs can now only be resolved through methods such as Image.resolveUrl() or Image.fetch(). However, the Image constructor is marked as @internal, so there is currently no public way to resolve an image URL when only the image hash is available.
Description of idea
It would be helpful to expose a public API such as Image.fromHash() (or an equivalent factory method) that creates an Image instance from only the image hash. This would restore the previous capability without exposing the internal constructor.
// example
let hash = "somthinghash1234";
let hasAvif = true;
let image = hitomi.Image.fromHash(hash, hasAvif);
let imageBuffer = await image.fetch(Extension.Avif, false);
Additional context
Description of problem
Before 9.0.0,
ImageandImageResolverwere separate. If you only had an image hash, you could resolve the image URL by passing the hash toImageResolver:Since 9.0.0,
ImageResolverhas been merged intoImage. URLs can now only be resolved through methods such asImage.resolveUrl()orImage.fetch(). However, theImageconstructor is marked as@internal, so there is currently no public way to resolve an image URL when only the image hash is available.Description of idea
It would be helpful to expose a public API such as
Image.fromHash()(or an equivalent factory method) that creates anImageinstance from only the image hash. This would restore the previous capability without exposing the internal constructor.Additional context