如何在 Linux(Ubuntu 22.04)终端中使用 ImageMagick 将 webp 文件转换为 jpg

问题描述 投票:0回答:2

我正在尝试使用 magick 命令行工具转换文件,但我对错误的含义以及如何修复它感到困惑。

我使用了以下代码语法:

magick <input>.webp <output>.jpg

我得到这个错误:

magick: delegate failed `'dwebp' -pam '%i' -o '%o'' @ error/delegate.c/InvokeDelegate/1911.
magick: unable to open file '/tmp/magick-PGSTH7P1-9rGkrCgVJrwRyuTCjBoRkrJ': No such file or directory @ error/constitute.c/ReadImage/780.

我正在转换的文件在我的当前目录中,我没有使用目录中已经使用的文件名。我已经确定我的拼写是正确的,我的文件类型也是正确的。

安装过程中也没有错误:

Testsuite summary for ImageMagick 7.1.0-40

我在虚拟机(Ubuntu 22.04)上运行它

image type-conversion imagemagick-convert image-conversion
2个回答
1
投票

我再次测试了这个,发现我需要:

sudo apt install build-essential pkg-config webp libwebp-dev libwebp7

然后您需要按照其余说明从源代码构建:

./configure
make -j 4

sudo make install
sudo ldconfig /usr/local/lib

0
投票

ffmpeg 对我来说工作得很好,假设你安装了 ffmpeg,这是很多视频播放器和转换器应用程序的基础。如果不是:

sudo apt install ffmpeg

在 ubuntu 和许多/大多数其他人上。 ——鲍勃·哈珀 我编写了它一次修复许多 webp 的脚本...... ---外壳代码--------------------------------

#!/bin/bash

对于 *.webp 中的文件;做

ffmpeg -i "$file" "${file/.webp}".jpg

完成

对于 *.WEBP 中的文件;做

ffmpeg -i "$file" "${file/.WEBP}".jpg

完成

如果需要添加更多...

echo "========================================"
ls -als *.jpg
echo "========================================"
---end-code-------------------------------------
© www.soinside.com 2019 - 2024. All rights reserved.