fix icon resizing code
authorBrett Parker <arch@sommitrealweird.co.uk>
Sun, 16 Apr 2006 10:06:12 +0000 (10:06 +0000)
committerBrett Parker <arch@sommitrealweird.co.uk>
Sun, 16 Apr 2006 10:06:12 +0000 (10:06 +0000)
Now understands that it needs to replace icons that are a different width to that specified on the command line in the case of updating a gallery.

git-archimport-id: arch@sommitrealweird.co.uk--2005-desktop/bpgallery--mainline--1.0--patch-12

TODO
bpgallery.sh

diff --git a/TODO b/TODO
index 05290a642933e95dd8485fbeac3b4ec74cb54935..28b52ffc6f8a7b9da3016e50ec9c1fefb7170cc6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,10 +1,9 @@
 * Add in a middle image size, so thumbs -> medium -> full size (and option for
   this)
-* Allow to recreate galleries and use new captions (only resizing changed
-  images) - mostly done, needs to be able to check and change based on
-  the width specified then it'll be finished
 * Allow a fixed height to be specified instead or as well as a fixed width, in
   the latter case, resize to which ever fits the bounding box, but keep the
   aspect ratio.
+* Allow ordering of images rather than the current "sort" based algorithm on
+  filename.
 * Make sure that the tools we require are available (i.e. check that we have
   xargs, convert, identify etc)
index 0317e0be6ab5ca2d849594cbcab6fb85ca33aedf..9e4b64c603a0c06ca0e2df5ce61b86b5d6464553 100755 (executable)
@@ -19,7 +19,7 @@
 
 set -f
 
-VERSION="1.0.1"
+VERSION="1.0.1+arch"
 
 function bpgallery_default_head() {
 cat <<END
@@ -309,14 +309,14 @@ if [ ! -d icons ]; then
 else
        echo "$1 already contains an icons folder, updating."
 
-       imagestoupdate=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} | while read filename; do filename=${filename//\"/\\\"}; if [ ! -r "icons/$filename" ] || [ "$filename" -nt "icons/$filename" ]; then $ECHOCOMMAND $filename; fi; done | $WCCOMMAND)
+       imagestoupdate=$($FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} | while read filename; do filename=${filename//\"/\\\"}; if [ ! -r "icons/$filename" ] || [ "$filename" -nt "icons/$filename" ] || [ $($IDENTIFYCOMMAND -format "%w" "icons/$filename") -ne $WIDTH ]; then $ECHOCOMMAND $filename; fi; done | $WCCOMMAND)
 
        echo "images to update: $imagestoupdate"
        
        
        currentimage=0
 
-       $FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} | while read filename; do tempfilename=${filename//\"/\\\"/}; if [ ! -r "icons/$tempfilename" ] || [ "$tempfilename" -nt "icons/$tempfilename" ] ; then $ECHOCOMMAND -n $filename; $ECHOCOMMAND -n -e "\000"; fi; done | $XARGSCOMMAND -0 --verbose --max-procs=4 --replace $CONVERTTOOL -resize $WIDTH '{}' 'icons/{}' 2>&1 | while read throwout; do $ECHOCOMMAND done: $currentimage/$imagestoupdate images; echo $throwout; currentimage=$((currentimage+1)); done
+       $FINDCOMMAND . $FINDIMAGESOPTIONS | $XARGSCOMMAND -0 --replace $ECHOCOMMAND {} | while read filename; do tempfilename=${filename//\"/\\\"/}; if [ ! -r "icons/$tempfilename" ] || [ "$tempfilename" -nt "icons/$tempfilename" ] || [ $($IDENTIFYCOMMAND -format "%w" "icons/$filename") -ne $WIDTH ]; then $ECHOCOMMAND -n $filename; $ECHOCOMMAND -n -e "\000"; fi; done | $XARGSCOMMAND -0 --verbose --max-procs=4 --replace $CONVERTTOOL -resize $WIDTH '{}' 'icons/{}' 2>&1 | while read throwout; do $ECHOCOMMAND done: $currentimage/$imagestoupdate images; currentimage=$((currentimage+1)); done
        echo done: $imagestoupdate/$imagestoupdate images
 fi