ImageMagick thumbnail generation and image preview


Introduction

Web File Share can make use of ImageMagick utility for generating image thumbnails and previews for PDF, PSD and other advanced file formats. ImageMagick also enables support for large (high-res) pictures in Web File Share.

GraphicsMagick (http://www.graphicsmagick.org) can also be used, and in some cases it can be faster and more efficient than ImageMagick

Installing ImageMagick

Please see http://www.imagemagick.org

Hewlett-Packard Graphics Language (HPGL) plotter files (.plt) can also be previewed with Web File Share and ImageMagick by installing “Hp2xx” (http://www.gnu.org/software/hp2xx/hp2xx.html). Windows version available here: http://gnuwin32.sourceforge.net/packages/hp2xx.htm

If you are running a Windows server, we recommend you to install ImageMagick to a path without space characters (like “Program Files”). You can install it for example to a path like “C:/ImageMagick”.

PDF Support

For ImageMagick to be able to generate thumbnails for PDF documents you will also need to install Ghostscript (http://www.ghostscript.com/download/gsdnld.html).

Setting up Web File Share

To enable ImageMagick please follow these steps:

  1. Login as superuser (default username “admin”).
  2. Open “Control Panel”.
  3. Go to “System configuration” » “File preview and thumbnails”.
  4. Enable ImageMagick.
  5. Set path to ImageMagick “convert” binary.

Example of valid paths:

Windows servers: C:/ImageMagick/convert.exe
Windows servers: C:/"Program Files"/ImageMagick/convert.exe
Linux servers: /usr/bin/convert

Troubleshooting

If you see broken icons instead of thumbnails:

  1. Make sure ImageMagick is working, running the following command: convert logo: image.jpg
  2. Make sure that Ghostscript is working. Try converting a PDF document using the command line: convert example.pdf example.png
  3. Make sure the path to ImageMagick is correctly configured in Web File Share's control panel.
  4. On Windows servers, make sure PHP can run external application. You need to give the Internet Guest User (IUSR_<your-computer-name>) “read & execute” permission on the file that PHP is trying to run ImageMagick trough. That would be “cmd.exe” (located usually inside the folder “C:/Windows/System32”), the file used for running programs trough the command line.


Article ID: 574
Created On: Wed, Mar 5, 2014 at 1:15 AM
Last Updated On: Fri, Nov 17, 2017 at 12:36 PM
Authored by: KB Admin01 [[email protected]]

Online URL: https://kb.quikbox.com/article.php?id=574