Author Topic: ImageMagick error  (Read 7046 times)

0 Members and 1 Guest are viewing this topic.

Offline adriennej511

  • album.pl User
  • *
  • Posts: 1
  • Karma: +0/-0
  • I forgot to change the default text
ImageMagick error
« on: April 17, 2004, 13:39:04 »
I get the following error when I try to use ImageMagick to make my thumbnails.

After I upload the pictures.  And then go to view the album and it shows all the thumbnails this is what I get.

Image Magick Error: sh: line 1: /usr/bin/convert: No such file or directory

How do I fix this?

Adrienne

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #1 on: April 17, 2004, 17:09:52 »
Hi Adrienne,

Looks like you've got the wrong path for your "imagemagick" setting... It's trying to load the "convert" program, but nothing's there. Is there another path you can try? What does album_test.pl say?


Cheers

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: ImageMagick error
« Reply #2 on: April 30, 2004, 06:42:13 »
Hi Mike,

I just upgraded my server to a new box, with windows server 2003, and I can't get image magic to make thumbnails.  It works at command prompt, the directory has read/execute permissions for IUS_<Domain>.  I've dried to turn on debug  ;debog=4, but I see no deb og info when the page loads.  How do I see the debog info?  Is there a config setting I have to turn on to get it to show.

http://www.akwiseman.com/cgi-bin/album.pl

this album has no thumbs created for it
http://www.akwiseman.com/cgi-bin/album.pl?album=Mary's%20old%20house;photo_height=500

Thanks in advance.
Adam

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #3 on: April 30, 2004, 13:10:54 »
You've probably changed your debug code (which is a good idea) so instread of "debug" try inserting your code. (It's at hte bottom of album.cfg if you're not sure...)

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: ImageMagick error
« Reply #4 on: April 30, 2004, 14:08:37 »
Of course, how silly of me, thanks. 

Ok got the debug.  Exelent debugging by the way. 

Here's some of the output of debug.  I've bolded the execute of convert, this run successfuly on the server in comandshell, and create a thmb.


7953: $::file=c:/myweb/Home/album/Easter 2004/100_0986.JPG, $myobject=100_0986.JPG
9102: Entering subroutine: genThumb(c:/myweb/Home/album/Easter 2004/100_0986.JPG,c:/myweb/Home/album/Easter 2004/thmb_100_0986.JPG,0)
2627: Checking to see if c:/myweb/Home/album/Easter 2004/100_0986.JPG is a photo...
2640: Yep, it's a photo.
9199: IMAGEMAGICK: "C:/Program Files/ImageMagick-5.5.7-Q8/convert" -quality 25 -resize x100 "c:/myweb/Home/album/Easter 2004/100_0986.JPG" "c:/myweb/Home/album/Easter 2004/thmb_100_0986.JPG"9202: IMAGEMAGICK RETURNED:
9302: Leaving subroutine: genThumb(c:/myweb/Home/album/Easter 2004/100_0986.JPG,c:/myweb/Home/album/Easter 2004/thmb_100_0986.JPG,0)
8018: Leaving subroutine: showThumb(100_0986.JPG)


Is there something else I should be looking for?

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: ImageMagick error
« Reply #6 on: April 30, 2004, 14:21:16 »
When I get home tonight, I'm going to double check that
C:/Program Files/ImageMagick-5.5.7-Q8/convert" -quality 25 -resize x100 "c:/myweb/Home/album/Easter 2004/100_0986.JPG" "c:/myweb/Home/album/Easter 2004/thmb_100_0986.JPG
build a thmb from cmd prompt

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #7 on: April 30, 2004, 17:47:37 »
Well, on the surface it looks ok. If there was a problem, generally it would show up in the ImageMagick output, but that line was blank. You're on the right track though... try that command in a dos window, and see if it generates a thumbnail. If it does, then you know it must be some sort of a permission on ImageMagick... like a temp dir where it's creating the thumbnails or something.

As a matter of fact, I've had this very same problem on a Windows box before, and I never did fix it...  :-\

P.S. You probably shouldn't post your debug code - people can do bad things with it. :)

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: ImageMagick error
« Reply #8 on: April 30, 2004, 21:26:53 »
Thanks for the tips, already changed my debug code.

I migrated from a windows 2000 server --> 2003.  I'm going to do a comparison of the security settings.  I've already insured IIS is set up the same, and the directory locations are idxenticle, because I did a strait copy.  I still have the other 2000 server, and it works fine, so I'll get to the bottom of this eventually.  I'll post when I figure it out.

Adam

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #9 on: May 01, 2004, 08:49:44 »
Hmmm... Windows 2003 has IISLockdown and URLScan on by default, I believe... Either one of those tools (but most likely IISLockdown) could the the culprit. You may want to re-run IISLockdown to disable some or all of it's security features, at least temporarilt (sorry, no idea how to do that - I reformatted my W2K3 server as Fedora Core 2 Test 3 yesterday :) ).

Offline adwiseman

  • album.pl Contributor
  • ***
  • Posts: 53
  • Karma: +3/-0
    • akwiseman
Re: ImageMagick error
« Reply #10 on: May 24, 2004, 18:36:01 »
Well I can't figure out why I can't get imagemagic to build thumbs when album.pl calls it.  I've made my old system, and new system as identical as possible.  I'm guessing it has to do with IIS 6.0.  Anyway, I'm not spending anymore time with it, I've written a batch script that I can run every night on the entire album, and generate thmb's for any picture that does not have one already.  Feal free to use, modify and distribute.

Code: [Select]
:: ******************************************************************
:: Execute the image magic convert function for all images with no thmbs in an album
::
:: Author:            Adam Wiseman
:: Created:           05/24/2004
:: Revision:          1.0
:: Language:          DOS batch files
::
:: Arguments
::    %1 = Path to base album directory where you want to start creating thmbs.
::    %2 = Path to imagemagic
::
:: Known Problems/Notes:
:: Does not like special charactors in file and directory names, like &
::
:: Revision History (most recent first):
:: *****************************************************************
::

@ECHO OFF

if /%1==/ goto USAGE

SET MAGIC=%2
::
:: If you want a different image magic default directory, change the below line
::
if /%2==/ SET MAGIC=C:/Program Files/ImageMagick-6.0.1-Q16
:: Strip off any quotes that where around the path
SET MAGIC=%MAGIC:"=%

SET STARTDIR=%CD%
SET ALBUM=%1
:: Strip off any quotes that where around the path
SET ALBUM=%ALBUM:"=%
set JUSTP=
set NAME=
set STRING=
set NAMEPATH=
SET THMB=thmb_

:: dir with no headers, and all dirctory and sub directory paths
SET SCRIPT='DIR /B /S "%ALBUM%*.jpg"'
:: loop through returned dir command, passing the path\filename to sub :SUB_FILE
FOR /F "tokens=1 delims==" %%A IN (%SCRIPT%) DO CALL :SUB_FILE "%%A"

goto END

:SUB_FILE
SET NAMEPATH=%1
:: Strip off any quotes that where around the path
SET NAMEPATH=%NAMEPATH:"=%
   
SET SCRIPT='DIR /B "%NAMEPATH%"'
FOR /F "tokens=1 delims==" %%A IN (%SCRIPT%) DO SET NAME=%%A
   
::get the first 5 char of filename
SET LNAME5=%NAME:~0,5%
     
::IF first 5 char = thmb_ then this is a thumbnail, don't create a thumb for this
IF NOT "%LNAME5%"=="%THMB%" CALL :SUB_CONVERT "%NAME%"

GOTO :EOF

:SUB_CONVERT
SET NAME=%1
:: Strip off any quotes that where around the path
SET NAME=%NAME:"=%

REM ** Get just the path from the filenamepath **
SET STRING=%NAMEPATH%
:GETDIRTOP
SET STRING=%STRING:~0,-1%
IF NOT "%STRING:~-1%"=="\" GOTO GETDIRTOP
SET JUSTP=%STRING%

REM ** Call the convert of the image **
IF NOT EXIST "%JUSTP%thmb_%NAME%" ECHO CREATING THMB %JUSTP%thmb_%NAME%
IF NOT EXIST "%JUSTP%thmb_%NAME%" "%MAGIC%/convert" -quality 25 -resize x100 "%NAMEPATH%" "%JUSTP%%THMB%%NAME%"


GOTO :EOF


cd %STARTDIR%
 
rem USAGE -- Got here if missing an command line argument
:USAGE
  echo.
  echo Usage : CRT_THMB.bat [album_path] [imagemagic path]
  echo.
  echo Takes 2 arguments:
  echo Arguments
  echo %%1 = Path to base album directory where you want to start creating thmbs.  Must include ending \
  echo %%2 = (Optional) Path to imagemagic, must include ending \  Default is C:/Program Files/ImageMagick-6.0.1-Q16
  echo.
  goto end

:END
  cd %STARTDIR%


Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #11 on: May 24, 2004, 19:56:10 »
Thanks Adam.... Sorry you never figured out what's going on, but I sure appreciate you sharing the batch script. :) Looks like you've done some batch scripting before!

Offline p5mmx10g

  • album.pl User
  • *
  • Posts: 15
  • Karma: +0/-0
  • I forgot to change the default text.
Re: ImageMagick error
« Reply #12 on: May 24, 2004, 20:20:04 »
i was having problem using imagemagick when i first install 2k3 server and copy all file from the 2000 server, it didn't create any thumbnail for me, but try to dl imagemagick ver 6.0 and up, and redownload album.pl, install it on a brand new directory, don't set anything advance, just get the basic running, i'm sure it will work, cause i'm using win2k3 server, iis6, perl 5x. imagemagic 6.0.0, http://speedyfoto.com/cgi-bin/pub/album.pl, if you have any question to set permission on folders, i can tell you what i have in mine...

Offline eChris

  • album.pl User
  • *
  • Posts: 3
  • Karma: +0/-0
  • I forgot to change the default text
Re: ImageMagick error
« Reply #13 on: May 31, 2004, 14:26:03 »
Please help! I'm another one suffering from this problem - Imagemagick works great from the command line but isn't creating any output when running through the web browser. I'm using IIS6, Win2003, ImageMagick 6, Activeperl 5.8.3

I've have allowed read/execute permissions to ImageMagick for IUSER_MYSERVER and all other permissions seem to be correct. Whats wrong!  :(

Debug shows this, so I assume imagemagick is being called ok but just cant create the output
Code: [Select]
9199: IMAGEMAGICK: "D:/Program Files/ImageMagick/convert" -quality 25 -resize 100x75 "D:/inetpub/wwwroot/XXX/album/IMG_7471.jpg" "D:/inetpub/wwwroot/XXX/album//thmb_IMG_7471.jpg"
9202: IMAGEMAGICK RETURNED:
9302: Leaving subroutine: genThumb(D:/inetpub/wwwroot/XXX/album/IMG_7471.jpg,D:/inetpub/wwwroot/XXX/album//thmb_IMG_7471.jpg,0)
8018: Leaving subroutine: showThumb(IMG_7471.jpg)

Any help much appreciated :)
« Last Edit: May 31, 2004, 14:30:08 by eChris »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: ImageMagick error
« Reply #14 on: May 31, 2004, 16:59:26 »
Well, it's almost certainly permissions... I set my IIS server to (temporarily) run as the admin account (as opposed to IUSR_hostname) and it generated thumbs OK.

You can try it as well, if you want to rule that in or out...

Beyond that, I still haven't figured out what permission is required... Maybe write on some temp space...?