chore: add message when resizing image
This commit is contained in:
parent
64e4a271e1
commit
4f98f778f0
9 changed files with 29 additions and 44 deletions
|
|
@ -1,33 +1,13 @@
|
|||
import { normalizeFiletype } from "../helpers/normalizeFiletype";
|
||||
import {
|
||||
convert as convertassimp,
|
||||
properties as propertiesassimp,
|
||||
} from "./assimp";
|
||||
import {
|
||||
convert as convertFFmpeg,
|
||||
properties as propertiesFFmpeg,
|
||||
} from "./ffmpeg";
|
||||
import {
|
||||
convert as convertGraphicsmagick,
|
||||
properties as propertiesGraphicsmagick,
|
||||
} from "./graphicsmagick";
|
||||
import {
|
||||
convert as convertLibjxl,
|
||||
properties as propertiesLibjxl,
|
||||
} from "./libjxl";
|
||||
import {
|
||||
convert as convertPandoc,
|
||||
properties as propertiesPandoc,
|
||||
} from "./pandoc";
|
||||
import {
|
||||
convert as convertresvg,
|
||||
properties as propertiesresvg,
|
||||
} from "./resvg";
|
||||
import { convert as convertassimp, properties as propertiesassimp } from "./assimp";
|
||||
import { convert as convertFFmpeg, properties as propertiesFFmpeg } from "./ffmpeg";
|
||||
import { convert as convertGraphicsmagick, properties as propertiesGraphicsmagick } from "./graphicsmagick";
|
||||
import { convert as convertLibjxl, properties as propertiesLibjxl } from "./libjxl";
|
||||
import { convert as convertPandoc, properties as propertiesPandoc } from "./pandoc";
|
||||
import { convert as convertresvg, properties as propertiesresvg } from "./resvg";
|
||||
import { convert as convertImage, properties as propertiesImage } from "./vips";
|
||||
import {
|
||||
convert as convertxelatex,
|
||||
properties as propertiesxelatex,
|
||||
} from "./xelatex";
|
||||
import { convert as convertxelatex, properties as propertiesxelatex } from "./xelatex";
|
||||
|
||||
|
||||
// This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular
|
||||
|
||||
|
|
@ -103,8 +83,7 @@ export async function mainConverter(
|
|||
) {
|
||||
const fileType = normalizeFiletype(fileTypeOriginal);
|
||||
|
||||
let converterFunc: ((filePath: string, fileType: string, convertTo: string, targetPath: string, options?: unknown) => unknown) | undefined;
|
||||
// let converterName = converterName;
|
||||
let converterFunc: typeof properties["libjxl"]["converter"] | undefined;
|
||||
|
||||
if (converterName) {
|
||||
converterFunc = properties[converterName]?.converter;
|
||||
|
|
@ -137,7 +116,7 @@ export async function mainConverter(
|
|||
}
|
||||
|
||||
try {
|
||||
await converterFunc(
|
||||
const result = await converterFunc(
|
||||
inputFilePath,
|
||||
fileType,
|
||||
convertTo,
|
||||
|
|
@ -147,7 +126,13 @@ export async function mainConverter(
|
|||
|
||||
console.log(
|
||||
`Converted ${inputFilePath} from ${fileType} to ${convertTo} successfully using ${converterName}.`,
|
||||
result,
|
||||
);
|
||||
|
||||
if (typeof result === "string") {
|
||||
return result;
|
||||
}
|
||||
|
||||
return "Done";
|
||||
} catch (error) {
|
||||
console.error(
|
||||
|
|
@ -279,4 +264,4 @@ export const getAllInputs = (converter: string) => {
|
|||
// }
|
||||
|
||||
// // print the number of unique Inputs and Outputs
|
||||
// console.log(`Unique Formats: ${uniqueFormats.size}`);
|
||||
// console.log(`Unique Formats: ${uniqueFormats.size}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue