forked from Shinonome/dots-hyprland
fix(floating-image): Fix gif not showing (#2610)
This commit is contained in:
@@ -18,14 +18,19 @@ Process {
|
|||||||
|
|
||||||
running: true
|
running: true
|
||||||
command: ["bash", "-c",
|
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 {
|
stdout: StdioCollector {
|
||||||
id: imageSizeOutputCollector
|
id: imageSizeOutputCollector
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const output = imageSizeOutputCollector.text.trim();
|
const output = imageSizeOutputCollector.text.trim();
|
||||||
const [width, height] = output.split(" ").map(Number);
|
const match = output.match(/(\d+)\s*x\s*(\d+)/);
|
||||||
root.done(root.filePath, width, height);
|
|
||||||
|
if (match) {
|
||||||
|
const width = Number(match[1]);
|
||||||
|
const height = Number(match[2]);
|
||||||
|
root.done(root.filePath, width, height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user