fix(floating-image): Fix gif not showing (#2610)

This commit is contained in:
end-4
2025-12-01 08:25:33 +01:00
committed by GitHub
@@ -18,14 +18,19 @@ Process {
running: true
command: ["bash", "-c",
`mkdir -p $(dirname '${processFilePath(filePath)}'); [ -f '${processFilePath(filePath)}' ] || curl -sSL '${sourceUrl}' -o '${processFilePath(filePath)}' && magick identify -format '%w %h' '${processFilePath(filePath)}'[0]`
`mkdir -p $(dirname '${processFilePath()}'); [ -f '${processFilePath()}' ] || curl -sSL '${sourceUrl}' -o '${processFilePath()}' && file '${processFilePath()}'`
]
stdout: StdioCollector {
id: imageSizeOutputCollector
onStreamFinished: {
const output = imageSizeOutputCollector.text.trim();
const [width, height] = output.split(" ").map(Number);
root.done(root.filePath, width, height);
const match = output.match(/(\d+)\s*x\s*(\d+)/);
if (match) {
const width = Number(match[1]);
const height = Number(match[2]);
root.done(root.filePath, width, height);
}
}
}
}