mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix all linter errors
This commit is contained in:
@@ -16,13 +16,14 @@ export class ImageNode extends BaseNode<ImageNodeParams> {
|
||||
}
|
||||
|
||||
private async load() {
|
||||
this.image = new Image();
|
||||
const image = new Image();
|
||||
this.image = image;
|
||||
const url = URL.createObjectURL(this.params.file);
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
this.image!.onload = () => resolve();
|
||||
this.image!.onerror = () => reject(new Error("Image load failed"));
|
||||
this.image!.src = url;
|
||||
image.onload = () => resolve();
|
||||
image.onerror = () => reject(new Error("Image load failed"));
|
||||
image.src = url;
|
||||
});
|
||||
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
@@ -25,17 +25,18 @@ export class StickerNode extends BaseNode<StickerNodeParams> {
|
||||
}
|
||||
|
||||
private async load() {
|
||||
this.image = new Image();
|
||||
const image = new Image();
|
||||
this.image = image;
|
||||
const color = this.params.color
|
||||
? `&color=${encodeURIComponent(this.params.color)}`
|
||||
: "";
|
||||
const url = `https://api.iconify.design/${this.params.iconName}.svg?width=200&height=200${color}`;
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
this.image!.onload = () => resolve();
|
||||
this.image!.onerror = () =>
|
||||
image.onload = () => resolve();
|
||||
image.onerror = () =>
|
||||
reject(new Error(`Failed to load sticker: ${this.params.iconName}`));
|
||||
this.image!.src = url;
|
||||
image.src = url;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ export class SceneExporter extends EventEmitter<SceneExporterEvents> {
|
||||
target: new BufferTarget(),
|
||||
});
|
||||
|
||||
const videoSource = new CanvasSource(this.renderer.canvas as any, {
|
||||
const videoSource = new CanvasSource(this.renderer.canvas, {
|
||||
codec: this.format === "webm" ? "vp9" : "avc",
|
||||
bitrate: qualityMap[this.quality],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user