changeset 47:d1ad806b6ee3 default tip

picsize and thumbsize are now numbers in any case (used printf); non-regular and non-existent files are skipped
author meillo@marmaro.de
date Mon, 23 Jun 2008 20:57:55 +0200
parents b991e188f1fa
children
files TODO genwebgallery
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Mon Jun 23 20:05:50 2008 +0200
+++ b/TODO	Mon Jun 23 20:57:55 2008 +0200
@@ -2,10 +2,7 @@
 
 - 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
+	mogrify 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
+	(is that solvable in any case??)
--- a/genwebgallery	Mon Jun 23 20:05:50 2008 +0200
+++ b/genwebgallery	Mon Jun 23 20:57:55 2008 +0200
@@ -202,12 +202,12 @@
 			shift
 			;;
 		'-ps' | '--pic-size')
-			sizePic="$2"
+			sizePic="`echo "$2" | awk '{printf("%d",$0)}'`"
 			shift
 			shift
 			;;
 		'-ts' | '--thumb-size')
-			sizeThumb="$2"
+			sizeThumb="`echo "$2" | awk '{printf("%d",$0)}'`"
 			shift
 			shift
 			;;
@@ -255,6 +255,13 @@
 fi
 
 for i in "$@" ; do
+	# skip over invalid files
+	if [ ! -f "$i" ] ; then
+		log "does not exist, or no regular file: $i"
+		log "  skipping"
+		continue
+	fi
+
 	file="`basename $i`"
 	targetFile="$targetDir/$file.htm"
 	log "processing file: $file"