Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: animated webp direct conversion

JovannMC2c520b832def
diff --git a/src/lib/converters/vertd/vertd.svelte.ts b/src/lib/converters/vertd/vertd.svelte.ts
index d9fde0c..ca7eac3 100644
--- a/src/lib/converters/vertd/vertd.svelte.ts
+++ b/src/lib/converters/vertd/vertd.svelte.ts
@@ -771,34 +771,11 @@ export class VertdConverter extends Converter {
): Promise<VertFile> {
if (to.startsWith(".")) to = to.slice(1);
- let fileUpload = input;
+ const fileUpload = input;
const conversionSettings = // vertd expects object not string json
Object.keys(settings).length > 4
? settings // user-provided settings
: Object.assign(settings, await this.getDefaultSettings(input)); // use defaults if not provided
- // if converting animated webp to video, first convert to gif
- // ffmpeg (in vertd) doesn't support decoding animated webp still.. while supporting encoding animated webp for some reason
- // https://trac.ffmpeg.org/ticket/4907
- if (input.from === ".webp") {
- this.log(`animated webp detected, converting to gif first`);
- const magickConverter = converters.find(
- (c) => c.name === "imagemagick",
- );
- if (magickConverter) {
- try {
- fileUpload = await magickConverter.convert(
- input,
- ".gif",
- conversionSettings,
- 100,
- );
- this.log(`successfully converted webp to gif`);
- } catch (e) {
- this.error(`failed to convert webp to gif: ${e}`);
- throw e;
- }
- }
- }
let hash: string;
if (PUB_DISABLE_FAILURE_BLOCKS === "false") {