Problem/Motivation
The module does not support creating thumbnail for PDF with space in their filename.
Proposed resolution
When the command line to run ImageMagick is created, it needs to enclose the filename in "
. This may be an issue with the ImageMagick module itself.
Initial report
Hello there,
I have been trying to get this configured for hours now with no success. I have the imageMagick library installed on the server and can get it to work from the command line, but every time i try to use it with the pdfPreview module i get:
User error: ImageMagick error 1: convert: no images defined `/var/www/youngforest.org/html/sites/default/files/pdfpreview/114-Young Forest Brochure 032513.jpg' @ error/convert.c/ConvertImageCommand/3187. in _imagemagick_convert_exec() (line 519 of /var/www/youngforest.org/html/sites/all/modules/imagemagick/imagemagick.module).
I don't know what i'm doing wrong to cause this error. Any help would be greatly appreciated.
Comments
Comment #1
code-drupal CreditAttribution: code-drupal commentedThe issue occurs because of spaces in the PDF filename. If you upload a PDF file without any spaces in the filename...it will work properly.
Comment #2
pbuyle CreditAttribution: pbuyle commentedComment #3
pbuyle CreditAttribution: pbuyle commentedComment #4
hctomI have the same problem on Mac OSX. When copying the executed command to the shell it does not work, too. But when I remove the quotes added by
escapeshellarg()
function for the target image file path, it works from the shell - I know this is not an option, but somehow this seems to be more of a problem withconvert
command's argument handling, doesn't it?Comment #5
ultrabob CreditAttribution: ultrabob commentedI don't know if everyone facing this issue is facing it on a mac, but in my experience this error had nothing to do with whether there was a space in the filename. The issue for me was that ghostscript was not in Apache's path. In El Capitan, making changes to the $PATH variable that Apache uses seems to be next to impossible without disabling SIP. I worked around it by modifying the path in my settings.php.
Comment #6
r0nn1ef CreditAttribution: r0nn1ef as a volunteer commentedI was experiencing this same issue in my dev environment in LinuxMint 17.3 with Apache 2.4.7 and PHP 5.5.9. When I unchecked the box for "Enable GraphicsMagick support" the problem appears to have gone away.
Comment #7
KarlSheaThis was also what fixed the issue for me, spaces in the filename weren't a problem. I'm running Homebrew's PHP-FPM and I had to make sure /usr/local/bin was in env[PATH] in php-fpm.conf (mine was at /usr/local/etc/php/5.6).
Comment #8
Mschudders CreditAttribution: Mschudders commentedMy problem on MAC OSX was that I didn't have the ghost binary installed.
You can check this via:
which gs
if this doesn't return anything you can quickly install it via:
brew install ghostscript
on linux it should be:
apt-get install ghostscript
Cheers
Comment #9
firewaller CreditAttribution: firewaller commentedTurns out even though I installed imagemagick via Homebrew, I still needed to install ghostscript. I then realized that MAMP had both, so I switched my image toolkit convert binary path to: /Applications/MAMP/Library/bin/convert and everything started working!
Comment #10
impara CreditAttribution: impara commentedIf you have the PHP imagick extension then change to that instead by doing:
Comment #11
clairedesbois@gmail.comI confirm #8, install ghostscript has solved the problem for me.