# HG changeset patch
# User meillo@marmaro.de
# Date 1210588886 -7200
# Node ID 572f219cf0f474ef85714888d9c75ef925366ebf
# Parent  7f3cea97b789a31bf9f9d4aeee66bf7cf2c19620
added skipping of not supported image types (still a problem in cornercases); updated TODO

diff -r 7f3cea97b789 -r 572f219cf0f4 TODO
--- 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
diff -r 7f3cea97b789 -r 572f219cf0f4 genwebgallery
--- 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