mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: extract first frame from multi-image FITS files
ImageMagick outputs numbered files (fits-out-0.png, fits-out-1.png) for multi-image FITS, but decodeFits expected a single output file. Added [0] selector to extract only the first frame, matching the pattern used by DDS and PSD decoders.
This commit is contained in:
@@ -438,7 +438,13 @@ async function decodeFits(buffer: Buffer): Promise<Buffer> {
|
||||
await writeFile(inputPath, buffer);
|
||||
await execFileAsync(
|
||||
cmd,
|
||||
magickArgs(cmd, [inputPath, "-normalize", "-colorspace", "sRGB", `png:${outputPath}`]),
|
||||
magickArgs(cmd, [
|
||||
`${inputPath}[0]`,
|
||||
"-normalize",
|
||||
"-colorspace",
|
||||
"sRGB",
|
||||
`png:${outputPath}`,
|
||||
]),
|
||||
{ timeout: 120_000 },
|
||||
);
|
||||
return await readFile(outputPath);
|
||||
|
||||
Reference in New Issue
Block a user