Welcome Guest, Not a member yet? Register   Sign In
Anyone managed to install ImageMagick with Linux, PHP Version 5.5.9-1ubuntu4.7
#1

(This post was last modified: 04-16-2015, 12:31 AM by John_Betong.)

The following works fine:
PHP Code:
 $thumbnail = new Imagick($pix);
 
 $wid 128;
 
 $thumbnail->thumbnailImage$wid);
 
 $thumbnail->enhanceImage();

 
 $thumbnail->sharpenimage(1,1,Imagick::CHANNEL_ALL); //$radius, $sigma, $channel);
 
 $ok $thumbnail->writeImage'thumbs/'.$thb ); 




Problem - cannot use CodeIgniter  Image Library: 
The $config['library_path'] is incorrect.



Tried the following without success:
PHP Code:
// PHP Version 5.5.9-1ubuntu4.7
$paths = array 
(
 
 '/opt/local/bin',
 
 '/opt/local/bin/',
 
 '/usr/bin/mogrify',
 
 '/usr/bin/mogrify/',
 
 '/usr/bin/convert',
 
 '/etc/php5/apache2/conf.d/'              // 20-imagick.ini
 
 '/etc/php5/apache2/conf.d/20-imagick.ini'// extension=imagick.so
 
 '/etc/ImageMagick',
 
 '/etc/ImageMagick/',
 
 '/usr/include/php5/ext/imagick',
 
 '/var/lib/dpkg/info/php5-imagick.prerm',
);
$path $paths[0..10]); // tried all 10 options :-(
echo '$path --> ' .$path .'<br />';

$this->load->library('image_lib');

$config['image_library'] = 'ImageMagick'// $config['image_library']     = 'imagick';
$config['library_path']    = $path;
...
...
if ( ! 
$this->image_lib->resize())
{
   echo 
'<h1 style="color:red">' .$this->image_lib->display_errors() .'</h1>';
}
// Output
 
  Image processing failed
 
  Please verify that your server supports the chosen protocol 
   
and that the path to your image library is correct
Reply
#2

(This post was last modified: 04-19-2015, 11:26 AM by John_Betong. Edit Reason: spelling: not my fortay :( )

Cracked it although it maybe a KLUDGE?

what through me was the incorrect error message stating the image_library path was incorrect which I knew was OK so I investigated CodeIgniter 3.0-0 source files:

File: ./CodeIgniinter 3.0-0/system/libraries/image_lib.php
PHP Code:
# Line: 887
$retval 1;
// exec() might be disabled
if (function_usable('exec'))
{
# MISSING function value
# @exec($cmd, $output, $retval);


# PLEASE READ POST: #4 - THIS MODIFICATION IS UNNECESSARY
# ADDED function value 
$retval = @exec($cmd$output$retval);


I was wondering,am I the only one using the ImageMagick library because without this modification the incorrect error message is returned?

Demo:
http://www.johns-jokes.com/welcome?toggle
Reply
#3

(This post was last modified: 04-18-2015, 09:40 AM by gadelat.)

Without corrupted language file it's impossible that line was causing given error about incorrect path, because that message is returned on a line far above the one you modified. Also, it's failing because imagemagick returns error status code. You should properly debug this by seeing output of $output var.
Reply
#4

(04-18-2015, 09:35 AM)gadelat Wrote: Without corrupted language file it's impossible that line was causing given error about incorrect path, because that message is returned on a line far above the one you modified. Also, it's failing because imagemagick returns error status code. You should properly debug this by seeing output of $output var.

I had spent a long time trying to get ImageMagick to work. I think it was coincidental that the modifications I made managed to get the library to work. I have since removed the modification and the image library is now working fine.

Mod: Please feel free to delete this thread.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB