Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 08:15 am EST

Geeklog Forums

ImageMagick/root install/mogrify


Status: offline

averageyoungman

Forum User
Chatty
Registered: 02/27/05
Posts: 36
Location:Brooklyn
Hello,

I have installed ImageMagick 6.2.0 on my hosted shared server. It is installed in a directory in my user root on this shared server. I can run both convert and mogrify from the command line fine, however I am getting the classic "resize trouble" issue when attempting to upload images larger than the set limit. I have read every post regarding this issue both here and what I found on the web and cannot find a solution. Here are my settings/versions:

Geeklog - 1.3.11
Server - Linux 2.4.20-30.7.legacysmp (shared server)
ImageMagick - Version 6.2.0 installed from ImageMagick-i686-pc-linux-gnu-1.tar.gz

$_CONF['image_lib'] = 'imagemagick';
$_CONF['path_to_mogrify'] = '/imedia/users/sk8mentald/mentalmagick/ImageMagick-6.2.0/bin/mogrify/'; (Have tried other paths, none work)
$_CONF['debug_image_upload'] = true;

• Runs from command line fine
• Works with images below or equal to "max_image_width", "max_image_height" & "max_image_size"
• "Trouble being resized" error can be reproduced with both .jpg and .gif files.
• Permissions all the way down to mogrify are set properly.


Error log information:

The path looks OK in the error logs as follows:
/imedia/users/sk8mentald/mentalmagick/ImageMagick-6.2.0/bin/mogrify/ -resize 200x150 "/imedia/users/sk8mentald/htdocs/blogmental/images/articles/20050319202438663_1.jpg" 2>&1


But what is the "2>&1" at the end of the error log output? I have looked at some other examples of ImageMagick related error log output in the forums and have not seen those extra characters on the end of the output line. Could that be part of the problem?

Mime type reporting in error logs is as follows:
File, ollie.jpg is of mime type image/jpeg and IS an image file.


One more thing: I can't run the display command as I do not have access to an X server on my shared server. I have no idea whether this is of any significance but I thought it was worth mentioning.

So, should I have ImageMagick in my htdocs? Could this be a version or platform issue? I realize based on looking at the forum posts that these issues are difficult to debug (per Dirk). That said if someone could give me some insight or perhaps a direction to go for debugging that would be great. I hope I didn't miss any potentially important information. To be clear I have also tried multiple versions of the path to mogrify, including no trailing slash.

Please help if you can. Thanks,

--aym
 Quote

Status: offline

averageyoungman

Forum User
Chatty
Registered: 02/27/05
Posts: 36
Location:Brooklyn
FYI:

I have attempted an installation in my htdocs directory and I get the same error. Just thought I'd let anyone who might respond know this.

Someone please help! Shocked
--aym
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by averageyoungman: $_CONF['path_to_mogrify'] = '/imedia/users/sk8mentald/mentalmagick/ImageMagick-6.2.0/bin/mogrify/';

This looks wrong. "mogrify" is an exectuable, not a path, i.e. this should not end in a slash.

bye, Dirk
 Quote

Status: offline

averageyoungman

Forum User
Chatty
Registered: 02/27/05
Posts: 36
Location:Brooklyn
Hi,

Thanks. I initially had it with no trailing slash. Didn't work in that case either. Had to decide which one to post. Sorry if that was confusing. I tried again with no trailing slash just to make sure and it failed with the same error. Is the "2>&1" at the end of the error log output correct? Nothing I do seems to help me isolate te problem. If you have time please take a look at all my settings to see if there is something that looks strange.

I installed it in the root of my shared server account, so it exists at the same level of my htdocs and not inside it or in a higher directory. My host is running a version of ImageMagick that Gl does not support, and said that they could not upgrade, so that is why I chose to attempt install myself. They said it should be fine where I've put it. Sorry if all of this is not useful info but I figure more info is best.

Even though I have it installed where I said, if I do "which mogrify" on the command line i get the following path: /usr/X11R6/bin/mogrify

In the error logs, GL is pointing to the right directory as I showed in my first post. Is there some kind of override I need to do for that path relative to may account? It seems to me that GL knows where mogrify is based on the error logs, and I set the ImageMagick environment vars as described on the following page (not using the environ library var for darwin):

http://www.imagemagick.org/www/QuickStart.html

Perhaps there is something specific to those environ vars that isn't properly set. As I said though, both -resize and -geometry work on the command line.

Thanks for your reply. Please help if you have time.
--aym
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
First of all: Are you sure the permissions on the exectuables are correct? Keep in mind that it's your webserver user ("nobody" or "wwwrun" or whatever it is called on your system) that is trying to execute those. So running them from the command line proves nothing ...

Quote by averageyoungman: Is the "2>&1" at the end of the error log output correct?

Yes. Just some output redirection trickery.


Quote by averageyoungman: Even though I have it installed where I said, if I do "which mogrify" on the command line i get the following path: /usr/X11R6/bin/mogrify

Then you obviously have a second ImageMagick install on that machine. This is the one that will be used when you type in, say, "identify" without any path. If you give the full path to the executable, then that file will be used.

bye, Dirk
 Quote

Status: offline

averageyoungman

Forum User
Chatty
Registered: 02/27/05
Posts: 36
Location:Brooklyn
Hey Dirk. Thanks for that. I did not realize that it was tthe server itself issuing the call.

I tried settingg everything to 777 and it still doesn't work, but I had a look at the apache.error_log for my shared server and the following is what I get when I attempt to upload a photo that does not match my size requirements:

sh: /mogrify: No such file or directory

So it appears that the server does not know the path. I know that my paths in config are correct, and if it is GL that is working in conjunction with the server to pass the call to mogrify, then it looks like the path is getting truncated somewhere. Doesn't appear to be on the GL side as the GL error lg displays the proper path. Obviously I could be wrong about that as I am no server engineer. Does that tell you anything?

Thanks again for the help. I'd like to get this solved if possible. being capable of policing user submissions would help a great deal.
--aym
 Quote

All times are EST. The time is now 08:15 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content