The next-generation file converter. Open source, fully local* and free forever.
feat: from DICOM, .env.example update
Maya7e16f9df94bd
diff --git a/.env.example b/.env.exampleindex 898e99a..44bd284 100644--- a/.env.example+++ b/.env.example@@ -16,9 +16,9 @@ PUB_VERTD_URL=https://vertd.vert.shPUB_DISABLE_ALL_EXTERNAL_REQUESTS=false# Set to true to disable blocking video conversions of an uploaded file when repeated failures-# occur within an hour. Useful for local deployments where secure context (HTTPS) may not be-# available - required for calculating file hashes of videos to block temporarily.-PUB_DISABLE_FAILURE_BLOCKS=false+# occur within an hour. Setting to false is only recommended for production deployments where+# secure context (HTTPS) is available, which is required for calculating file hashes of videos to block temporarily.+PUB_DISABLE_FAILURE_BLOCKS=true# Stripe donation settings# Please keep these values the same, they support VERT's development!diff --git a/src/lib/converters/magick/magick.svelte.ts b/src/lib/converters/magick/magick.svelte.tsindex 0368b3a..8e3d4fd 100644--- a/src/lib/converters/magick/magick.svelte.ts+++ b/src/lib/converters/magick/magick.svelte.ts@@ -52,6 +52,8 @@ export class MagickConverter extends Converter {new FormatInfo("eps", false, true),new FormatInfo("psd", true, true),+ new FormatInfo("dcm", true, false),+// raw camera formatsnew FormatInfo("arw", true, false),new FormatInfo("tif", true, true),@@ -151,6 +153,20 @@ export class MagickConverter extends Converter {break;}+ const toRes = (+ w: number,+ h?: number,+ ): { value: string; label: string } => {+ if (w && h) {+ if (w < h)+ return { value: `${w}x${h}`, label: `${w}x${h} (V)` };+ if (w > h) return { value: `${w}x${h}`, label: `${w}x${h}` };+ return { value: `${w}x${h}`, label: `${w}x${h}` };+ }+ if (w) return { value: `${w}x${w}`, label: `${w}x${w}` };+ return { value: "", label: "" };+ };+const quality: SettingDefinition = {key: "quality",label: m["convert.settings.image.quality"](),@@ -163,28 +179,29 @@ export class MagickConverter extends Converter {// TODO: surely there's a better way to do this as wellconst iconResolutions = [- { value: "16x16", label: "16x16" },- { value: "32x32", label: "32x32" },- { value: "48x48", label: "48x48" },- { value: "64x64", label: "64x64" },- { value: "128x128", label: "128x128" },- { value: "256x256", label: "256x256" },- { value: "512x512", label: "512x512" },+ toRes(16),+ toRes(32),+ toRes(48),+ toRes(64),+ toRes(128),+ toRes(256),+ toRes(512),];const commonResolutions = [{value: "custom",label: m["convert.settings.common.custom"](),},- { value: "426x240", label: "426x240" },- { value: "640x360", label: "640x360" },- { value: "854x480", label: "854x480" },- { value: "720x1280", label: "720x1280 (V)" },- { value: "1280x720", label: "1280x720" },- { value: "1080x1920", label: "1080x1920 (V)" },- { value: "1920x1080", label: "1920x1080" },- { value: "2160x3840", label: "2160x3840 (V)" },- { value: "3840x2160", label: "3840x2160" },+ toRes(320, 240),+ toRes(426, 240),+ toRes(640, 360),+ toRes(854, 480),+ toRes(720, 1280),+ toRes(1280, 720),+ toRes(1080, 1920),+ toRes(1920, 1080),+ toRes(2160, 3840),+ toRes(3840, 2160),];const resolution: SettingDefinition = {key: "resolution",diff --git a/src/lib/workers/magick.ts b/src/lib/workers/magick.tsindex 669cb96..0fe1800 100644--- a/src/lib/workers/magick.ts+++ b/src/lib/workers/magick.ts@@ -300,7 +300,7 @@ const magickConvert = async (}}- if (fmt === "ICO") && !singleSize) {+ if (fmt === "ICO" && !singleSize) {const standardSizes = [16, 24, 32, 48, 64, 128, 256, 512];let desired = 0;@@ -318,13 +318,16 @@ const magickConvert = async (}if (desired <= 0) desired = Math.max(...standardSizes);- if (desired > Math.max(...standardSizes)) desired = Math.max(...standardSizes);+ if (desired > Math.max(...standardSizes))+ desired = Math.max(...standardSizes);const sizes = standardSizes.filter((s) => s <= desired);if (sizes.length === 0) sizes.push(Math.min(...standardSizes));const sourcePng = await new Promise<Uint8Array>((resolve) => {- img.write(MagickFormat.Png, (o: Uint8Array) => resolve(structuredClone(o)));+ img.write(MagickFormat.Png, (o: Uint8Array) =>+ resolve(structuredClone(o)),+ );});console.log(`encoding sizes for ico: ${sizes.join(", ")}`);@@ -337,18 +340,27 @@ const magickConvert = async (new MagickReadSettings({ format: MagickFormat.Png }),);- const scale = size / Math.max(variant.width, variant.height);+ const scale =+ size / Math.max(variant.width, variant.height);const newW = Math.max(1, Math.round(variant.width * scale));- const newH = Math.max(1, Math.round(variant.height * scale));+ const newH = Math.max(+ 1,+ Math.round(variant.height * scale),+ );variant.resize(newW, newH);collection.push(variant);- console.log(`added size ${size}x${size} to MagickImageCollection`);+ console.log(+ `added size ${size}x${size} to MagickImageCollection`,+ );}- collection.write(fmt as unknown as MagickFormat, (o: Uint8Array) => {- resolve(structuredClone(o));- });+ collection.write(+ fmt as unknown as MagickFormat,+ (o: Uint8Array) => {+ resolve(structuredClone(o));+ },+ );});});}@@ -362,6 +374,7 @@ const magickConvert = async (const transparency = conversionSettings.transparency as boolean;const metadata = conversionSettings.metadata as boolean;+ // magick-wasm automatically clamps (https://github.com/dlemstra/magick-wasm/blob/76fc6f2b0c0497d2ddc251bbf6174b4dc92ac3ea/src/magick-image.ts#L2480)if (quality) img.quality = quality;if (bitDepth) img.depth = bitDepth;if (!metadata) img.strip();@@ -399,7 +412,6 @@ const magickConvert = async (img.alpha(AlphaAction.Remove);}- // magick-wasm automatically clamps (https://github.com/dlemstra/magick-wasm/blob/76fc6f2b0c0497d2ddc251bbf6174b4dc92ac3ea/src/magick-image.ts#L2480)img.write(fmt as unknown as MagickFormat, (o: Uint8Array) => {resolve(structuredClone(o));});