feat: raw camera formats, swf

This commit is contained in:
Maya 2025-07-30 10:42:23 +03:00
parent 723e4f9a8c
commit 8911cdab8d
No known key found for this signature in database
5 changed files with 30 additions and 11 deletions

View File

@ -56,7 +56,7 @@ export class FFmpegConverter extends Converter {
new FormatInfo("mp1", true, false),
new FormatInfo("mp2", true, true),
new FormatInfo("mpc", true, false), // unknown if it works, can't find sample file but ffmpeg should support i think?
new FormatInfo("raw", true, false), // usually pcm
//new FormatInfo("raw", true, false), // usually pcm
new FormatInfo("dsd", true, false), // dsd
new FormatInfo("dsf", true, false), // dsd
new FormatInfo("dff", true, false), // dsd

View File

@ -41,6 +41,7 @@ export const imageFormats = [
new FormatInfo("farbfeld", true, true),
new FormatInfo("fax", true, true), // not ideal (image became super long for some reason)
new FormatInfo("ff", true, true),
new FormatInfo("fit", true, true), // not ideal (grayscale)
new FormatInfo("fits", true, true), // not ideal (grayscale)
new FormatInfo("fl32", true, true),
new FormatInfo("fts", true, true), // not ideal (grayscale)

View File

@ -19,6 +19,7 @@ export class MagickConverter extends Converter {
public ready = $state(false);
public supportedFormats = [
// manually tested formats
new FormatInfo("png", true, true),
new FormatInfo("jpeg", true, true),
new FormatInfo("jpg", true, true),
@ -40,20 +41,40 @@ export class MagickConverter extends Converter {
new FormatInfo("cr2", true, false),
new FormatInfo("hdr", true, true),
new FormatInfo("jpe", true, true),
new FormatInfo("dng", true, false),
new FormatInfo("mat", true, true),
new FormatInfo("pbm", true, true),
new FormatInfo("pfm", true, true),
new FormatInfo("pgm", true, true),
new FormatInfo("pnm", true, true),
new FormatInfo("ppm", true, true),
new FormatInfo("tif", true, true),
new FormatInfo("tiff", true, true),
new FormatInfo("jfif", true, true),
new FormatInfo("eps", false, true),
new FormatInfo("arw", true, false),
new FormatInfo("psd", true, true),
// raw camera formats
new FormatInfo("arw", true, false),
new FormatInfo("tif", true, true),
new FormatInfo("dng", true, false),
new FormatInfo("xcf", true, false),
new FormatInfo("rw2", true, false),
new FormatInfo("raf", true, false),
new FormatInfo("orf", true, false),
new FormatInfo("pef", true, false),
new FormatInfo("mos", true, false),
new FormatInfo("raw", true, false),
new FormatInfo("dcr", true, false),
new FormatInfo("crw", true, false),
new FormatInfo("cr3", true, false),
new FormatInfo("3fr", true, false),
new FormatInfo("erf", true, false),
new FormatInfo("mrw", true, false),
new FormatInfo("mef", true, false),
new FormatInfo("nrw", true, false),
new FormatInfo("srw", true, false),
new FormatInfo("sr2", true, false),
new FormatInfo("srf", true, false),
// formats added from maya's somewhat automated testing
...imageFormats,
];

View File

@ -226,6 +226,7 @@ export class VertdConverter extends Converter {
new FormatInfo("rmvb", true, false),
new FormatInfo("h264", true, true),
new FormatInfo("divx", true, true),
new FormatInfo("swf", true, true),
];
// eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -28,13 +28,9 @@ const handleMessage = async (message: any): Promise<any> => {
case "convert": {
if (!message.to.startsWith(".")) message.to = `.${message.to}`;
message.to = message.to.toLowerCase();
if (message.to === ".jfif") {
message.to = ".jpeg";
}
if (message.input.from === ".jfif") {
message.input.from = ".jpeg";
}
if (message.to === ".jfif") message.to = ".jpeg";
if (message.input.from === ".jfif") message.input.from = ".jpeg";
if (message.input.from === ".fit") message.input.from = ".fits";
const buffer = await message.input.file.arrayBuffer();
// only wait when we need to