我在 AWS EC2 实例上收到以下错误(我特别说,因为我在我的 Mac 上没有这个问题):
Error: Command failed: gm convert: No decode delegate for this image format (/tmp/5c5830319d29e4678e8691cd-1549705844271.jpg)
该文件确实存在,以防万一看起来是嫌疑人。
我的gm配置如下:
[mw-user@mwServer ~]$ gm version
GraphicsMagick 1.3.31 2018-11-17 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2018 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP no
DPS no
FlashPix no
FreeType no
Ghostscript (Library) no
JBIG no
JPEG-2000 no
JPEG no
Little CMS no
Loadable Modules no
OpenMP yes (201511)
PNG no
TIFF no
TRIO no
UMEM no
WebP no
WMF no
X11 no
XML no
ZLIB yes
Host type: x86_64-pc-linux-gnu
Configured using the command:
./configure
Final Build Parameters:
CC = gcc
CFLAGS = -fopenmp -g -O2 -Wall -pthread
CPPFLAGS =
CXX = g++
CXXFLAGS = -pthread
LDFLAGS =
LIBS = -lz -lm -lpthread
我正在使用节点模块:
var gm = require('gm');
gm("/tmp/5c5830319d29e4678e8691cd-1549705844271.jpg")
.resize(450, null)
.write("/tmp/5c5830319d29e4678e8691cd-1549705844271-Resized.jpg", (function(err){
if (err) {
console.log(err);
}
}));
我对通用汽车的了解还不够,无法从这里去任何地方。问题似乎我没有 JPEG 的“转换器”。问题是 - 如何设置它以支持大多数图像格式,如:jpg、png 等?
提前致谢!