How to enable imagemagick?

I have both gd and imagemagick installed on my system but I can't work out how to switch to imagemagick. Any ideas? I upgraded from a previous version and it didn't give me the option in the setup and I can't find it in the options.

Also is imagemagick faster than GD for thumbnail generation on their install?

Information from php -i:
imagick

imagick module => enabled
imagick module version => 2.1.1-rc1
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version => ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org
ImageMagick copyright => Copyright (C) 1999-2009 ImageMagick Studio LLC
ImageMagick release date => 2009-11-26
ImageMagick Number of supported formats: => 202
ImageMagick Supported formats => 3FR, A, AI, ART, ARW, AVI, AVS, B, BGR, BMP, BMP2, BMP3, BRF, BRG, C, CAL, CALS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FITS, FRACTAL, FTS, G, G3, GBR, GIF, GIF87, GRADIENT, GRAY, GRB, GROUP4, HALD, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RBG, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive => Local Value => Master Value
imagick.locale_fix => 0 => 0
«1

Comments

  • acrylian Administrator
    To enable Imagick there is a checkbox on Options > Image right on top. At least on my host it does not seem really noticable faster.
  • Many thanks, not sure how I missed that! In a quick test I have found imagemagick to be a bit slower.
  • Hello,

    I am a web designer and I am working on a Zenphoto upgrade to version 1.3. Thumbnails are not being generated and the hosting company (ASmallOrange) mentioned the GD engine thumbnail process was being terminated because of memory problems, and suggested I switch to ImageMagick. I read the above post but I can't seem to find the option acrylian mentions (which I could attach a screenshot) to enable Imagemagick.

    The version I am using is Zenphoto version 1.3 [5479]

    Just in case it is something else, this is what I have in the Setup log and below, what I see when I debug any thumbnail:
    Zenphoto Setup v1.3[5479] Fri, 06 Aug 2010 15:43:46 -0400
    warn: PHP magic_quotes_gpc [is enabled] You should consider disabling magic_quotes_gpc. For more information See What is magic_quotes_gpc and why should it be disabled? in the Zenphoto troubleshooting guide.
    warn: PHP mbstring package [Your internal character set is ISO-8859-1] Setting mbstring.internal_encoding to UTF-8 in your php.ini file is recommended to insure accented and multi-byte characters function properly.
    warn: File/Folder Permissions [are loose (0777)] If file and folder permissions are not set to strict or tighter there could be a security risk. However, on some servers Zenphoto does not function correctly with tight file/folder permissions. If Zenphoto has permission errors, run setup again and select a more relaxed permission.Change file/folder permissions mask: strict+ (0750) strict (0755) relaxed (0775) loose (0777)
    warn: Zenphoto core files [Some files are missing or seem out of variance] Perhaps there was a problem with the upload. You should check the following files: zp-core/zp-config.php.source
    warn: Zenphoto core file permissions [not correct] Setup could not set the one or more components to the selected permissions level. You will have to set the permissions manually. See the Troubleshooting guide for details on Zenphoto permissions requirements.

    ***********

    Album: [ trainset-ghetto ], Image: [ 1_small.jpg ]

    Image filesize: 431697

    Debug i.php | Arguments:
    size = 100
    width =
    height =
    cw = 85
    ch = 85
    cx =
    cy =
    quality = 75
    thumb = 1
    crop = 1

    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/petebaum/public_html/gallery/zp-core/lib-GD.php on line 70

    Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/petebaum/public_html/gallery/albums/trainset-ghetto/1_small.jpg' is not a valid JPEG file in /home/petebaum/public_html/gallery/zp-core/lib-GD.php on line 70

    Warning: filemtime() [function.filemtime]: stat failed for /home/petebaum/public_html/gallery/cache/trainset-ghetto/1_small_100_cw85_ch85_thumb.jpg in /home/petebaum/public_html/gallery/zp-core/i.php on line 197

    Thanks in advance for any advice.
  • Most of what you've posted is indicative of what you've already said: that GD is causing memory problems. If you're using 1.3.0, you will see the option to use Imagick if:
    • Your server's environment is running PHP5
    • The Imagick PHP extensions is available
    I would assume that at least one of those requirements isn't met. You should be able to check both of those requirements using `phpinfo()` (see http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#9) or by asking your host.
  • That seems a rather small image to be causing memory problems. But, it is not the file size that is the issue, it is the pixel dimensions. What are those for the image?
  • Is it possible that I don't see that checkbox on Options > Image right on top ?

    Gaston
  • As I said above, the option will only be present if Imagick is available on your server. So if you don't see it, then it's not available.
  • Thanks. Before I talk to my host (iweb), I would like to know is there a lot of gain in using this (or having it available) ?

    Gaston
  • It depends on what you need out of Zenphoto, I suppose. The library is made to work close to the same as GD. One main difference is that Imagick isn't sharing memory with Apache, so it shouldn't have as many memory issues as GD. Another is that, with the latest changes, color profiles should be preserved between an image and its sized/thumbnail versions. It should also preserve transparency when resizing, whereas GD can have issues.

    I have heard that it can be a tad slower than GD, but I do intend on working on that. :)
  • Thanks,

    Gaston
  • Hi,

    I just want to verify that with Zenphoto 1.3.1, there is currently no way to use ImageMagick?

    Thanks,

    p
  • acrylian Administrator
    If your server supports that you can enable it on Options > Image. The option will not be there if your server does not have it of course. Technically it is Imagick we support and it requires PHP 5+.
  • Weird...I'm running PHP 5.2.6 and I verified that my server is running ImageMagick 6.2.4 but I don't see that option when I go to Options> Image.

    I see that in my zp-core directory I have lib-Imagick.php which is good. Should my my PHP5_functions directory have an Imagick file? Right now it has _functions_GD.php but nothing regarding Imagick.
  • acrylian Administrator
    No, the lib-imagick.php is directly in the zp-core folder.. Note that there are several variants that hook on ImageMagick: http://www.imagemagick.org/script/index.php

    We currently have only support for Imagick. I am sure that kagutsuchi who did it for us will respond soon, too.
  • Your server probably only provides ImageMagick and not Imagick, which is what `lib-Imagick` uses. Imagick is a PHP module that basically wraps the ImageMagick functionality and provides a native way of using that functionality from PHP.

    You could always ask your host to install the module for you. I know that my host allows dynamically adding modules to PHP, so perhaps that is an option as well. Only your host would know for sure, though.
  • Hi, I had the same problem as Pedram with Imagick: the check box didn't appear in options>image. So I am trying another host, well known in the US to be one of the best support for Zenphoto.
    It has Imagick and the check box appears in the options>image.
    As a matter of fact, Imagick allows thumbnails to keep the color profiles of the full size image. It's a great improvement.
    I am on Zenphoto 1.3.1, no problem so far.
    However, and this is another question, with my new host, as big company he might be, the display process is a lot slower than with my previous host. I made the update following the instructions you provide, using a database backup etc, and it works perfectly except that it's so slow that sometimes I have to refresh my browser to get the picture displayed.
    I copied the cache folder from my ancient version, but still, for some reason, it seems overloaded. Why? Thank you.
  • acrylian Administrator
    Color profiles of course only help if the visitor has a browser that takes care of them!

    Regarding the picture display: Zenphoto generates the thumbs and sized images on the fly when they are requested the first time and then caches them. Depending on the power of the server and the sizes of these images this might vary from host to host (and on the current traffic as well). Even with Imagick I suggest not to upload 10mp images or the like.

    Also Zenphoto is file system based because of that you can just upload folders with images to your albums folder and they become albums and images once Zenphoto discovers them.

    Additionally I suggest to try the static-html cache plugin.
  • As acrylian said, it is pretty much dependent on the image size (not filesize). Other than that, it could be a hosting issue. Image processing also depends on the available memory, so if your new host has less memory or is overselling or some such, perhaps you could encounter some issues. Once an image is cached, however, you shouldn't really notice any such slowdowns.
  • I have imagick installed on my server, as it shows up under php_info; however i am still unable to enable it in zenphoto?? there is no check box showing.

    socalbavarians.com/info.php
  • acrylian Administrator
    There should be a checkbox on options > image
  • i am not seeing it; i even installed a fresh copy of yesterdays nightly build onto another site on the same server and the check box is still not showing up...

    imagick module version: @PACKAGE_VERSION@

    could this be the problem?
  • That would certainly be the problem. Why your module version would be showing like that, however, I have no clue. You will probably need to contact your host about this issue. Perhaps recompiling Imagick would fix the package version.
  • hi, i have installed imagick-3.0.1 and i have activated Imagick in zenphoto succesfully. But the tif s are still not working/shown ... any suggestions?

    thx
  • acrylian Administrator
    It is probably not installed correctly on your server then. Note that some file formats in Imagick require extra packages to be installed. See the imagick website for info.
  • ok - thx for the tip
  • i found the problem: my files have the ending ".tif" ... with ".tiff" its working
  • It does seem possilbe that the library is excluding "tif", But the expert on the library, kagutsuchi would have to comment on that. He is a bit busy with school right now, so may take a bit for a response.
  • libtiff supports both .tiff and the alternative .tif. ImageMagick gets information directly from that lib, so it really should work for both unless something is screwed up in the configuration of libtiff, ImageMagick, or Imagick. You'll have to see if your host can find the issue.
  • I also had a lot of problems with the "red lightning bolt" (red crack? red slash? What the heck IS that thing) appearing for thumbnails.

    Resolved it by enabling imagemagick, deleting all the files (not directories!) under cache.

    As noted above, getting imagemagick installed properly can be a pain -- you have to have ImageMagick the tool, and imagemagick the php extension as well. Finally broke down and installed pecl and imagick, which required PHP 5.4, which wanted a later version of MySQL, which wanted a horse, which wanted a nail, etc. Ugh.

    But at least my thumbnails work now. Sigh.
  • I'm also having trouble getting the Imagick option to be enabled on options | image ("The Imagick extension is not available.") I'm working with the provider of my hosted VPS to ensure that all the elements are installed and configured correctly. They say that:
    . Package ImageMagick-6.7.8.9-15.el7_2.x86_64 already installed and latest version
    . We enabled ImageMagick for PHP 5.6.
    . We have have added extension=imagick.so to your local.ini for PHP 5.6 and restarted Apache

    I can see this extension in the php.ini file, but there's no sign of it in my phpInfo.php output, which I assume is the problem. I know this is not a hosting forum, but does anyone have any tips on what else needs to happen?

Sign In or Register to comment.