Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 10:18 am EST

Geeklog Forums

User Image Resizing Issues


Status: offline

fatnick

Forum User
Junior
Registered: 10/20/02
Posts: 21
I've searched the site for about an hour before posting this but couldn't come up with anything other than "check your paths." I did check them and they are correct. Anyways, here is the problem...

I have both imagemagick and netpbm installed on my windows2000 webserver (using Apache). In the config.php for the photo resizing bit I set it to ImageMagick and the path to mogrify.exe is set. When I try to upload a file that should be resized I get this error.

Text Formatted Code
Image, fnhulk1.JPG had trouble being resized: mogrify.exe: unable to open module file `D:\ImageMagick\modules\coders\IM_MOD_RL_JPG'_.dll'.

 


I noticed that for some reason there is an apostrophe before the last underscore character. Could there be something in the code to get rid of that? I'm not really much of a programmer so if it's a big pain I can get by without fixing it and just posting a notice to all the users to keep their files within the limits. But if anyone has a quick answer I'd appreciate a response.

Oh yeah, the file uploads with no problem but doesn't attach itself to the user profile nor is it resized on the server.

Thanks a bunch.

Nick
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Sounds more like a setup issue with ImageMagick itself. Can you run it from the command line?

bye, Dirk
 Quote

Status: offline

fatnick

Forum User
Junior
Registered: 10/20/02
Posts: 21
Yes, I can do everything from the command line and it's what I have chosen to run Gallery with and that also has no problems.
 Quote

Status: offline

fatnick

Forum User
Junior
Registered: 10/20/02
Posts: 21
I reinstalled ImageMagick with their Windows Executable from their website and now I get this error...

Text Formatted Code
Image, fnhulk1.JPG had trouble being resized: mogrify.exe: unable to open file `'d:/webroot/images/userphotos/FN.JPG'': No such file or directory.
 


I tried to check to see maybe if it was a rights issue but it's all gravy as far as the rights goes.
 Quote

Status: offline

JohnVanVliet

Forum User
Full Member
Registered: 10/09/03
Posts: 161
have you checked and set lines 492 to 500 in the config.php file
 Quote

suprsidr

Anonymous
You have to give IUSR_machinename execute priveledges to mogrify.exe
 Quote

Status: offline

fatnick

Forum User
Junior
Registered: 10/20/02
Posts: 21
Double checked permissions....they are set. Checked my config.php file and everything looks good.

Text Formatted Code
Image, fnhulk1.JPG had trouble being resized: mogrify.exe: unable to open file `'d:/webroot/images/userphotos/FN.JPG'': No such file or directory.
 


That is the output now.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by fatnick: unable to open file `'d:/webroot/images/userphotos/FN.JPG'': No such file or directory.

Hmm. The image file names are enclosed in single quotes to avoid problems if they contain spaces. This works fine on Unix, Linux, etc. but apparently Windows thinks they're part of the file name.

Try this:

In system/classes/upload.class.php find this piece of code (search for "pathToMogrify", second occurence):
Text Formatted Code
$cmd = $this->_pathToMogrify . ' -resize '. $newsize . " '" . $this->_fileUploadDirectory . '/' . $this->_getDestinationName() . "' 2>&1";
 

See the single quotes inside the double quotes? Remove them so that it reads
Text Formatted Code
$cmd = $this->_pathToMogrify . ' -resize '. $newsize . " " . $this->_fileUploadDirectory . '/' . $this->_getDestinationName() . " 2>&1";
 

Now that I look at this, I'm wondering about the " 2>&1" bit, too (for Windows at least). Maybe remove that one as well:
Text Formatted Code
$cmd = $this->_pathToMogrify . ' -resize '. $newsize . " " . $this->_fileUploadDirectory . '/' . $this->_getDestinationName();
 

See if that helps. It won't work if you have any spaces in your file or directory names, though.

bye, Dirk
 Quote

suprsidr

Anonymous
try placing a copy of cmd.exe in your imagemagick root you'll find it in system32 make sure it also has IUSR_xxx exec. rights. Sometimes windows cannot find cmd.exe when it needs it.
This works for IIS, hopefully for apache too.
 Quote

Status: offline

fatnick

Forum User
Junior
Registered: 10/20/02
Posts: 21
I did both of your suggestions...The code change AND putting CMD in the imagemagick root folder...the result is IT WORKED!!!!

Thank you so so so so much!
 Quote

All times are EST. The time is now 10:18 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