-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
Hi there. It might be me, but I get gif image output instead of png
Here's the code, which I wrote for tests
// How I imported it
import { WebpMachine } from "webp-hero/dist-cjs/index.js";
...
// How I initialize it at GameLoader's constructor
this.webp = new WebpMachine({useCanvasElements: false, webpSupport: false});
...
// On each resource load, I am adding new img to the body for test only
private async onAfterResourceLoaded(resource: PIXI.LoaderResource, next: (...args: any[]) => void, loader: GameLoader) {
if (resource.extension == "webp") {
let image = resource.data as HTMLImageElement;
await loader.webp.polyfillImage(image);
image.width = 100;
image.height = 100;
if (!image.src.endsWith("webp")) {
// Conversion was made by webp-hero
image.style.cssText = "position: fixed; left: 0px; top:50px; width: 100px; height: 100px";
document.body.appendChild(image);
}
}
next();
}
On iOS 14 and 15 I can see the png images rendered as they should. At iOS 13 and lower I can not see anything and the img is gif.
Please note all the images has the same src.
npm list webp-hero
returns [email protected]
Any help appriciated.
Thx in advance.