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.
:: ******************************************************************
:: 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%