Loading...
 
Skip to main content

Imagick Scale Image failure after upgrade, showing icon instead of picture

Status
Closed
Subject
Imagick Scale Image failure after upgrade, showing icon instead of picture
Version
6.x
Category
  • Error
Feature
File Gallery (elFinder or standard UI)
Image Gallery
Resolution status
Fixed or Solved
Submitted by
Nelson Ko
Lastmod by
Ushindi Gedeon
Rating
(0)
Description
After upgrading from 3 to 6, resizing of images fail. I tracked it down to Imagick's scaleImage function resulting in broken image, hence all that is shown is the GIF icon. This is the case when using the {img tag with size set.
Solution

Need proper fix, by making option to not use Imagick but GD instead. Workaround to force GD instead of Imagick is as follows:

Copy to clipboard
Index: lib/images/images.php =================================================================== --- lib/images/images.php (revision 35491) +++ lib/images/images.php (working copy) @@ -14,13 +14,13 @@ // This assumes imagick is better than gd (which does not handle transparency in gray PNG), so try to find it first // $detected_lib = ''; -if ( class_exists('Imagick') ) { - $detected_lib = 'imagick_new'; // Imagick 2.x -} elseif ( function_exists('imagick_rotate') ) { - $detected_lib = 'imagick_old'; // Imagick 1.x -} elseif ( function_exists('gd_info') ) { +//if ( class_exists('Imagick') ) { +// $detected_lib = 'imagick_new'; // Imagick 2.x +//} elseif ( function_exists('imagick_rotate') ) { +// $detected_lib = 'imagick_old'; // Imagick 1.x +//} elseif ( function_exists('gd_info') ) { $detected_lib = 'gd'; // GD -} +//} if ($detected_lib != '') { // Load the detected lib
Workaround
Importance
7
Priority
35
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
3949
Created
Tuesday 19 July, 2011 23:32:00 UTC
by Nelson Ko
LastModif
Thursday 02 July, 2026 09:08:12 UTC


Show PHP error messages