X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=picstohtml.sh;fp=picstohtml.sh;h=0000000000000000000000000000000000000000;hb=6473993b691c6280c4ad1d1d9a3b697eb0e05eb2;hp=70310c2dd4253850cf3b4d35e6f1f8e0a056ca61;hpb=5d1aa1fd3b6c8a003dd3789791a349f34a0b0c14;p=scripts.git diff --git a/picstohtml.sh b/picstohtml.sh deleted file mode 100755 index 70310c2..0000000 --- a/picstohtml.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -######################################################################### -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the version 3 of the GNU General Public License # -# as published by the Free Software Foundation. # -# # -# This program is distributed in the hope that it will be useful, but # -# WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # -# General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -# Written by and Copyright (C) Francois Fleuret # -# Contact for comments & bug reports # -######################################################################### - -function error () { - echo $1 1>&2 - exit 1 -} - -###################################################################### -# Create the directories - -if [[ -z $1 ]] || [[ -z $2 ]]; then - echo "$0 " - exit 1 -fi - -if [[ ! -d $1 ]]; then - echo "Can not find directory $1" - exit 1 -fi - -mkdir $2 || error "Can not create $2." -mkdir $2/pics || error "Can not create $2/pics" -mkdir $2/thumbs || error "Can not create $2/thumbs" - -###################################################################### -# Generate the html header - -cat > $2/index.html < - - - - - - - - - - - -EOF - -###################################################################### -# Generate the thumbnails, html content and copy the images - -for i in $(find $1 -type f | sort); do - FILENAME=$(basename $i) - convert 2> /dev/null -geometry 180x120 $i $2/thumbs/${FILENAME}.jpg - - if [[ $? == 0 ]]; then - echo "Copying ${FILENAME}" - cp $i $2/pics/${FILENAME} - echo "" >> $2/index.html - else - echo "Ignoring $i (not an image?)" - fi - -done - -###################################################################### -# Generate the footer of the html file - -cat >> $2/index.html < - - -EOF - -######################################################################