mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
fix: get gif size properly
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user