ImageMagickToolkitHelper.class at line 592

YAFA

Joined: 2006-01-12
Posts: 10
Posted: Sun, 2009-11-22 00:58

Hello everybody,

I have a problem, that I kind of solved after some search in the code. This post is something between "There is a problem", a bugreport and a temporary solution, until it's really fixed. So please don't kill me for posting it here. People having this problem will search and find it in the Troubleshooting-section. I think that fits best.

If you have a gallery 2.3 installation with the ImageMagick-Module v1.1.5 and you run into this error-message on saving the path-settings:

Error (ERROR_TOOLKIT_FAILURE)
in modules\imagemagick\classes\ImageMagickToolkitHelper.class at line 592 (GalleryCoreApi::error)
in modules\imagemagick\AdminImageMagick.inc at line 255 (ImageMagickToolkitHelper::discoverVersion)
in modules\core\SiteAdmin.inc at line 209 (AdminImageMagickView::loadTemplate)
in modules\core\classes\GalleryView.class at line 293 (SiteAdminView::loadTemplate)
in main.php at line 465 (GalleryView::doLoadTemplate)
in main.php at line 104
in main.php at line 88

the version-checking in line 583 doesn't really work. Maybe that is, because ImageMagick changed its output on 'identify -version'.

My ImageMagick-Version is 6.5.7-9 Q16 static

I don't advise to change the code and return a hardcoded version-information, but it works:


    foreach ($results as $resultLine) {
        if (preg_match('/(ImageMagick|GraphicsMagick)s+([d.r-]+)/', $resultLine, $matches)) {
        $version = array($matches[1], $matches[2]);
        $vulnerable = ($version[0] == 'ImageMagick' &&
                   version_compare($version[1], '6.3.3-5', '<')) ||
                  ($version[0] == 'GraphicsMagick' &&
                   version_compare($version[1], '1.1.6-r1', '<'));
        //return array(null, $version, $vulnerable);     -- comment this out
        }
    }
    
    //return array(GalleryCoreApi::error(ERROR_TOOLKIT_FAILURE), null, null);     -- comment this out
    $version[0] = "ImageMagick";             // -- insert this
    $version[1] = "6.5.7-9";                 // -- insert this
    return array(null, $version, false);     // -- insert this


Gallery version: 2.3
PHP version: 5.2.11 (x86)
Webserver: IIS 6
Database: MySQL 5.1.41 community edition
Operating system: Windows Server 2003 x64