From 5d86aca235a329b07943dcc455f1b08efebab877 Mon Sep 17 00:00:00 2001 From: David Purdue <17368933+davidpurdue@users.noreply.github.com> Date: Tue, 25 Jan 2022 11:24:46 +1100 Subject: [PATCH] Fix #2 - allow for spaces in file names --- instascale.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instascale.sh b/instascale.sh index ac47d8c..8053642 100755 --- a/instascale.sh +++ b/instascale.sh @@ -33,8 +33,8 @@ do echo "Working on $image" # Get the dimensions of the original image - old_width=$(magick identify -format "%[fx:w]" $image) - old_height=$(magick identify -format "%[fx:h]" $image) + old_width=$(magick identify -format "%[fx:w]" "$image") + old_height=$(magick identify -format "%[fx:h]" "$image") # Calculate the dimentions of the new image new_width=1080 @@ -51,5 +51,5 @@ do fi # Resize the image - magick $image -resize ${new_width}x${new_height} -background white -compose Copy -gravity center -extent ${new_width}x${new_height} -quality 90 Instagram/$image + magick "$image" -resize ${new_width}x${new_height} -background white -compose Copy -gravity center -extent ${new_width}x${new_height} -quality 90 "Instagram/$image" done