diff --git a/dots/.config/quickshell/ii/modules/common/utils/ImageDownloaderProcess.qml b/dots/.config/quickshell/ii/modules/common/utils/ImageDownloaderProcess.qml index 11ff92a6d..3a86b2fe1 100644 --- a/dots/.config/quickshell/ii/modules/common/utils/ImageDownloaderProcess.qml +++ b/dots/.config/quickshell/ii/modules/common/utils/ImageDownloaderProcess.qml @@ -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); + } } } }