diff options
-rwxr-xr-x | anondcim | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -30,7 +30,7 @@ which jhead 2>/dev/null || which exiftool 2>/dev/null || die "jhead or exiftool # set default values file_prefix="" dst_size="1280" -dst_dir="--same--" +dst_dir="" while getopts ':p:s:d:' OPTION do @@ -58,10 +58,9 @@ total=$# for fn in "$@" do - if [ "$dst_dir" = "--same--" ] - then - # if the filename contains a "/" then use this dir - [ "$fn" != "${fn%/*}" ] && dst="${fn%/*}/" || dst="" + if [ -z "$dst_dir" ]; then + # use the directory of the source file + dst="$(dirname "$fn")/" else dst="$dst_dir" fi |