Mercurial > 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 wrap: on
line diff
--- a/TODO Mon May 12 12:37:14 2008 +0200 +++ b/TODO Mon May 12 12:41:26 2008 +0200 @@ -1,6 +1,11 @@ TODO: - security checks + - navigation in pic pages (really?) + - verify that input files are images + convert doesnt always return an error code if it is no supported image type + so is the problem with gimp's xcf format + - verify picture and thumbnail sizes are numbers
--- a/genwebgallery Mon May 12 12:37:14 2008 +0200 +++ b/genwebgallery Mon May 12 12:41:26 2008 +0200 @@ -230,6 +230,14 @@ targetFile="$targetDir/$file.htm" log "processing file: $file" + # copy and resize pics + convert "$i" -resize ${sizePic}x${sizePic} "$targetDir/$file" + if [ $? -ne 0 ] ; then + log " skipping" + continue + fi + convert "$i" -resize ${sizeThumb}x${sizeThumb} "$targetDir/_$file" + # generate pic page echo `insertHeader` > "$targetFile" if [ "$galleryTitle" != "" ] ; then @@ -241,10 +249,6 @@ fi echo `insertFooter` >> "$targetFile" - # copy and resize pics - convert "$i" -resize ${sizePic}x${sizePic} "$targetDir/$file" - convert "$i" -resize ${sizeThumb}x${sizeThumb} "$targetDir/_$file" - # generate content for index file echo " <a href=\"$file.htm\"><img src=\"_$file\" alt=\"$file\" /></a>" >> "$targetDir/$index" done