coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Mellissa on February 19, 2004, 10:47:52 PM

Title: Issue Using Image Magick
Post by: Mellissa on February 19, 2004, 10:47:52 PM
I want to use .gif files in my gallery so I decided to use Image Magick rather than the GD I used before. I contacted my host and he told me where the plugin thing was located but when I put it in, the script told me that it wasn't located there or I didn't have permission to access it.

I contacted my host again and he told me that the path was correct but maybe it was something with the script. Is there anything I can do? Or install?
Title: Issue Using Image Magick
Post by: moorey on February 20, 2004, 04:20:23 AM
What was the path that your host told you where ImageMagick is located? The exact path that you'll need is to IM's "convert" utility.

In the config page for CPG, the path should look something like:
Quote/usr/bin/
or
Quote/usr/local/bin/
Also make sure you or CPG has permission to execute the convert utility.
Title: Issue Using Image Magick
Post by: Mellissa on February 20, 2004, 10:20:23 PM
They told me it was:

/usr/local/bin/

How can I be sure that the script has permission to execute it?
Title: Issue Using Image Magick
Post by: Mellissa on February 22, 2004, 06:15:30 AM
Hello?
Title: Issue Using Image Magick
Post by: hyperion on February 22, 2004, 07:00:07 AM
Patience is the greatest of all virtues.
-Cato the Elder
Title: Issue Using Image Magick
Post by: Mellissa on February 22, 2004, 07:02:24 AM
I'm sure it is. But I've got a section of my site that's still not up due to this error and I'm sorry--but I'm rather impatient to get it done.
Title: Issue Using Image Magick
Post by: hyperion on February 22, 2004, 07:14:21 AM
A bit pushy, aren't you? It's the weekend, and a Sunday at that. However, I choose to take pity on you. After all, sometimes persistence pays off, or it could be that your brashness amuses me. :)  


<?php 
$path_to_image 
realpath&#40;"image.jpg"&#41;;
passthru&#40;"convert -geometry 400x300 \"$path_to_image\" -"&#41;; 
?>



Here is a test script for ImageMagick. It will convert image.jpg to a pixel size of 400x300. Your permissions will be correct when you run this script and the image is resized. (You will have to check it manually.)

When Moorey tells you to check the script's permission to access convert, he means you must ask your host to make sure you and the server have proper access permissions to use IM's convert utility.  If the webmaster never uses IM, she may not know it isn't properly permissioned.
Title: Issue Using Image Magick
Post by: hyperion on February 22, 2004, 08:19:34 AM
Oh yes, just remembered you're on a *nix system, so you'll need the full path in the test script.

/usr/local/bin/


<?php 
$path_to_image 
realpath&#40;"image.jpg"&#41;; 
passthru&#40;"/usr/local/bin/convert -geometry 400x300 \"$path_to_image\" -"&#41;; 
?>


Title: Issue Using Image Magick
Post by: Mellissa on February 23, 2004, 12:43:34 AM
I really appreciate your help and I'm sorry if I come off pushy :(

I tried the test script and it resized the image the way I guess it's supposed to but when I tried to run the install again, it still gave me the error.

I contacted my host again and he said that it was possible it was a permissions problem and that I need a more verbose explanation so he can fix it. I have no idea what he's looking for--I've copied and pasted what you guys have said to me to him and he still needs more.

Maybe I should just give up on including animated images.
Title: Issue Using Image Magick
Post by: hyperion on February 23, 2004, 01:02:20 AM
No need to give up, this is just getting interesting. The fact that the image was resized while the install script rejects the setup means that something important is going on.  Try this little test script:


<?php

$path1 
'/usr/local/bin/';
$path2 '/usr/local/bin';

if &
#40;is_dir&#40;$path1&#41;&#41; &#123;

print "Yes, $path1 is a directory.<br><br>";

&
#125; else &#123;

print "No, $path1 is not a directory.<br><br>";

&
#125;

if &#40;is_dir&#40;$path2&#41;&#41; &#123;

print "Yes, $path2 is a directory.<br><br>";

&
#125; else &#123;

print "No, $path2 is not a directory.<br><br>";

&
#125;

?>



Tell us the results of this script.  It will check to see if something is preventing the install script from detecting the IM directory.
Title: Issue Using Image Magick
Post by: Mellissa on February 23, 2004, 01:06:18 AM
No, /usr/local/bin/ is not a directory.

No, /usr/local/bin is not a directory.


That's what comes up when I run the script.
Title: Issue Using Image Magick
Post by: hyperion on February 23, 2004, 01:12:03 AM
Okay, as a workaround, set up Coppermine using GD (CPG will detect GD).  Then change the method in the Config panel to IM, and enter the IM path in the config panel box.  Then try to upload an image (after you get the config set the way you want -- create an album and try one pic with GD before you change the settings to IM).  Let us know what happens.

I'm signing off now, so don't wait around for an instant reply. :)
Title: Issue Using Image Magick
Post by: Mellissa on February 23, 2004, 01:15:04 AM
Oh...it works! Thank you so much for all of your help :)
Title: Issue Using Image Magick
Post by: moorey on February 23, 2004, 02:44:03 AM
I apologise for not replying earlier on.  Hyperion's great with the tricks! The IM path is an interesting one.