mirror of https://github.com/VERT-sh/VERT.git
feat: actually handle image resolution setting
i added it to svg but forgot to add it for the rest of the images, nice
This commit is contained in:
parent
8b965c4e77
commit
4db3c69249
|
|
@ -533,6 +533,13 @@ export class MediabunnyConverter extends Converter {
|
|||
stay: 10000,
|
||||
},
|
||||
});
|
||||
|
||||
if (!isValid) {
|
||||
this.activeConversions.delete(file.id);
|
||||
throw new Error(
|
||||
`Mediabunny cannot produce an output for ${file.name} due to unsupported tracks/codecs.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
conversion.onProgress = (progress) => {
|
||||
|
|
|
|||
|
|
@ -293,6 +293,22 @@ const magickConvert = async (
|
|||
let fmt = to.slice(1).toUpperCase();
|
||||
if (fmt === "JFIF") fmt = "JPEG";
|
||||
|
||||
const resolution = conversionSettings.resolution as string;
|
||||
if (resolution && resolution !== "auto") {
|
||||
const actualResolution =
|
||||
resolution === "custom"
|
||||
? (conversionSettings.customResolution as string)
|
||||
: resolution;
|
||||
|
||||
const [width, height] = actualResolution
|
||||
.split("x")
|
||||
.map((dim: string) => parseInt(dim));
|
||||
|
||||
if (width && height) {
|
||||
img.resize(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
// ICO size clamp to avoid WidthOrHeightExceedsLimit
|
||||
if (fmt === "ICO") {
|
||||
const max = 256;
|
||||
|
|
|
|||
Loading…
Reference in New Issue