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
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:
[list]
[]Your server's environment is running PHP5
[]The Imagick PHP extensions is available
[/list]
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.
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.
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.
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.
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.
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.