I am trying to generate a thumbnail for different Pdf's using ImageMagick. The below command works for most of the scenarios. However, it fails for very few PDF's.
The following the command I am using.
/usr/local/bin/convert “a.pdf[0]" -thumbnail 300x143 -strip -quality 80.0 -colorspace sRGB -intent relative -density 72 -auto-orient -background white -alpha remove “b.jpeg"
The following is the error I received for the failed ones.
convert: no decode delegate for this image format PNG' @ error/constitute.c/ReadImage/556.
convert: no images defined
/mnt/cgi_otmm/assethub/stage/thumb/vol1/INTERNAL_7e9439b4-c5bb-4a46-a81d-738d2c138432_pdf_thumb.jpeg' @ error/convert.c/ConvertImageCommand/3288.
I have installed ImageMagick manually from the source as mentioned in the below URL.
https://www.imagemagick.org/script/install-source.php
I have installed the delegates manually from the location https://www.imagemagick.org/download/delegates/.
I have installed libjpeg, libpng, libFreeType and libTiff
I have used the following commands to install the same. The commands to install it are taken from one the comments in stackoverflow. ImageMagick no decode delegate
wget http://www.imagemagick.org/download/delegates/jpegsrc.v9a.tar.gz
sudo tar xvf jpegsrc.v9a.tar.gz -C /usr/local/src/
cd /usr/local/src/jpeg-9a
./configure --enable-shared
make
sudo make install