genwebgallery
changeset 24:572f219cf0f4
added skipping of not supported image types (still a problem in cornercases); updated TODO
author | meillo@marmaro.de |
---|---|
date | Mon, 12 May 2008 12:41:26 +0200 |
parents | 7f3cea97b789 |
children | 9fac7c9e2611 |
files | TODO genwebgallery |
diffstat | 2 files changed, 13 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/TODO Mon May 12 12:37:14 2008 +0200 1.2 +++ b/TODO Mon May 12 12:41:26 2008 +0200 1.3 @@ -1,6 +1,11 @@ 1.4 TODO: 1.5 1.6 - security checks 1.7 + 1.8 - navigation in pic pages (really?) 1.9 + 1.10 - verify that input files are images 1.11 + convert doesnt always return an error code if it is no supported image type 1.12 + so is the problem with gimp's xcf format 1.13 + 1.14 - verify picture and thumbnail sizes are numbers
2.1 --- a/genwebgallery Mon May 12 12:37:14 2008 +0200 2.2 +++ b/genwebgallery Mon May 12 12:41:26 2008 +0200 2.3 @@ -230,6 +230,14 @@ 2.4 targetFile="$targetDir/$file.htm" 2.5 log "processing file: $file" 2.6 2.7 + # copy and resize pics 2.8 + convert "$i" -resize ${sizePic}x${sizePic} "$targetDir/$file" 2.9 + if [ $? -ne 0 ] ; then 2.10 + log " skipping" 2.11 + continue 2.12 + fi 2.13 + convert "$i" -resize ${sizeThumb}x${sizeThumb} "$targetDir/_$file" 2.14 + 2.15 # generate pic page 2.16 echo `insertHeader` > "$targetFile" 2.17 if [ "$galleryTitle" != "" ] ; then 2.18 @@ -241,10 +249,6 @@ 2.19 fi 2.20 echo `insertFooter` >> "$targetFile" 2.21 2.22 - # copy and resize pics 2.23 - convert "$i" -resize ${sizePic}x${sizePic} "$targetDir/$file" 2.24 - convert "$i" -resize ${sizeThumb}x${sizeThumb} "$targetDir/_$file" 2.25 - 2.26 # generate content for index file 2.27 echo " <a href=\"$file.htm\"><img src=\"_$file\" alt=\"$file\" /></a>" >> "$targetDir/$index" 2.28 done