Jump to content

Little help with imagemagick - not working but no errors..?


DamienRoche

Recommended Posts

I'm currently using Hostgator and have tried several different paths to imagemagick. I am using a function I found on the net.

 

Thing is, it isn't working but isn't throwing out any errors. (I have report all errors on etc.)

 

Here is the function I'm using:

 

<?php

function createThumbIMK($img, $imgPath, $thumbDir, $suffix, $newWidth, $newHeight) {

  $newNameE = explode(".", $img);
  $newName = "$newNameE[0]"." $suffix ".'.'."$newNameE[1]";

  $uploadedImg = ".'uploads'.'/'. $imgPath .'/'. $img .";
  $newThumb = ".'uploads'.'/'. $thumbDir .'/'. $newName .";
  $newRes = ". $newWidth .'x'. $newHeight .";

  $ct = system("/usr/local/convert -resize $newRes $uploadedImg $newThumb", $retval);

return $ct;

########### IN USE

list($width,$height)=getimagesize($target_path);

$newwidth1 = "300";
$newheight1 = ($height/$width)*$newwidth1;
$suf = "-tn";

echo "new dimensions: $newwidth1 X $newheight1";

createThumbIMK($file, $id, $id, $suf, $newwidth1, $newheight1);

?>

 

The $file is the name - correct. The $id is the folder in uploads which is dynamic and created before I run the function.

 

Have tried several paths - usr/bin/X11/ - usr/bin/ - usr/local/bin/

 

I just can't suss this out...anybody had any similar issues?

 

Thanks.

 

Uppin....

 

Has anyone worked with imagemagick before? Is there a way I can ensure I am referring to the right path?

 

Something like SERVER['DOCUMENT_ROOT'] -

 

Any input is much appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.