ImageMagick without write access on a filer gives no images

Author Message

Xavier Gouley

Monday 29 September 2008 4:06:58 am

Hi,

In a special cluster configuration, we have a filer and 3 web servers. Only one of these servers (admin server) can write to the filer (eZpublish PHP files). (Cache folders are not in the filer, but locally to each one).

The problem is that in this configuration, the servers who have no write access to the filer (in the Var directory, especially) can't generate proper cache file for image that are not in the original image class.

In details :
When a web server want to build its cache files, it calls lib/ezimage classes. In these classes, ImagieMagick is called to build non original image classes files (medium, tiny, etc...). BUT when the image already exists, ImageMagick is even called to write above each image (to make the same image sometimes...). When write access is not given, ImageMagick returns false, and then the image is not included in the cache files.

Have ever tried this configuration ? Have you got a good solution to correct this ?

I made the following patch in /lib/ezimage/classes files :
ezimageshellhandler.php, line 142 :
replaced "return false;" by "return file_exists( $destinationMimeData['url'] );"
ezimagemanager.php, line 914 :
removed "return false" line, to let execution continue...

With these modifications, when write access is not given, and the image already exists, the image is returned (even if it is outdated... but it is better thant nothing !) ; and when the image does not exists yet, the original image is used instead (better than nothing, also...)

Have a better solution ? Do you think it is a bug ?

Xavier Gouley
http://www.gxapplications.com/eng_blog/GX-Admin-s-Blog/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.