I am getting the below error on an AWS EC2 instance (I specifically say that as I don't have an issue with this on my Mac):
Error: Command failed: gm convert: No decode delegate for this image format (/tmp/5c5830319d29e4678e8691cd-1549705844271.jpg)
The file does exist just in case that looks to be the suspect.
My config for gm is as follows:
[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
I am using the Node module:
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);
}
}));
I don't know enough about gm to go anywhere from here. The problem seems like I don't have a "converter" for JPEG. Question is - how does one set this up so it supports most image formats like: jpg, png etc?
Thanks in advance!
You don't say what OS your instance is running, but basically you don't seem to have JPEG
support in GraphicsMagick.
So you need to work out what package manager your instance uses and then use that to install libjpeg
and libjpeg-dev
packages and then probably re-install GraphicsMagick.
Your comment seems to imply your question is broader than the JPEG-support you mention, but the answer is the same. You need to install
and then re-install GraphicsMagick.