Skip to content

Commit

Permalink
arwtojpg: Create directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed Oct 25, 2023
1 parent 0cfdd4b commit f7ed337
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/arwtojpg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ out_dir=${2?output dir missing}
shopt -s globstar nullglob

for raw_file in "$in_dir"/**/*.ARW; do
jpg_file=${raw_file##*/}
jpg_file=${raw_file#"$in_dir"/}
jpg_file=$out_dir/${jpg_file%.*}.jpg

jpg_dir=${jpg_file%/*}

if [[ $jpg_dir != "$jpg_file" ]]; then
mkdir -p "$jpg_dir"
fi

if [[ -e "$jpg_file" ]]; then
# TODO: wtf? why do some of these come out as garbage and need redoing?
if file "$jpg_file" | grep -q orientation=; then
Expand Down

0 comments on commit f7ed337

Please sign in to comment.