From 02552571ce64016d8c3e14b444f70103adc7fb04 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Sat, 13 Jun 2009 21:27:41 +0000 Subject: [PATCH] Should allow import filenames w/ spaces now. (SourceForge #1527884, we got poked about it via Ubuntu) --- docs/CHANGES.txt | 6 +++++- src/tuxpaint-import.sh | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 0aa3850a4..36cc7ae10 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2009.June.11 (0.9.21) +2009.June.13 (0.9.21) * New Starters: ------------- * Silver Frame @@ -293,6 +293,10 @@ $Id$ Pere Pujal i Carabantes and Albert Cahalan + * 'tuxpaint-import' script didn't support files with spaces. Fixed. + James Le Cuirot + + 2008.June.26 (0.9.20) * New translations: ----------------- diff --git a/src/tuxpaint-import.sh b/src/tuxpaint-import.sh index 80f402322..c2c0f0d3a 100755 --- a/src/tuxpaint-import.sh +++ b/src/tuxpaint-import.sh @@ -5,7 +5,7 @@ # "Tux Paint Import" # Import an arbitrary GIF, JPEG or PNG into Tux Paint -# (c) Copyright 2002-2006, by Bill Kendrick and others +# (c) Copyright 2002-2009, by Bill Kendrick and others # bill@newbreedsoftware.com # http://www.newbreedsoftware.com/tuxpaint/ @@ -25,7 +25,7 @@ # (See COPYING.txt) -# September 21, 2002 - August 12, 2006 +# September 21, 2002 - June 13, 2009 SAVEDIR=$HOME/.tuxpaint @@ -145,13 +145,13 @@ for x in $(seq 1 $#) do i="${!x}" - if [ -e $i ]; then + if [ -e "$i" ]; then # Determine a filename for it: NEWFILENAME=`date "+%Y%m%d%H%M%S"` echo "$i -> $SAVEDIR/saved/$NEWFILENAME.png" # Convert and scale down, save as a temp file: - anytopnm $i | pnmscale -xysize $width $height > $TMPDIR/saved/$NEWFILENAME.ppm + anytopnm "$i" | pnmscale -xysize $width $height > $TMPDIR/saved/$NEWFILENAME.ppm # Place inside the correctly-sized canvas: # FIXME: Center, instead of placing at upper right