summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xanondcim9
1 files changed, 4 insertions, 5 deletions
diff --git a/anondcim b/anondcim
index 44dacf2..aa4902b 100755
--- a/anondcim
+++ b/anondcim
@@ -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
contact: Jan Huwald // Impressum