Issue Using Image Magick Issue Using Image Magick
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Issue Using Image Magick

Started by Mellissa, February 19, 2004, 10:47:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mellissa

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?

moorey

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.

Mellissa

They told me it was:

/usr/local/bin/

How can I be sure that the script has permission to execute it?

Mellissa


hyperion

Patience is the greatest of all virtues.
-Cato the Elder
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Mellissa

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.

hyperion

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.
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

hyperion

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;; 
?>


&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Mellissa

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.

hyperion

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.
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Mellissa

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.

hyperion

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. :)
&quot;Then, Fletch,&quot; that bright creature said to him, and the voice was very kind, &quot;let&#039;s begin with level flight . . . .&quot;

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

Mellissa

Oh...it works! Thank you so much for all of your help :)

moorey

I apologise for not replying earlier on.  Hyperion's great with the tricks! The IM path is an interesting one.