Skip to content

Instantly share code, notes, and snippets.

@greg-randall
Created October 17, 2021 20:39
Show Gist options
  • Select an option

  • Save greg-randall/61813bea6a3907304541a4a01cbd4dd7 to your computer and use it in GitHub Desktop.

Select an option

Save greg-randall/61813bea6a3907304541a4a01cbd4dd7 to your computer and use it in GitHub Desktop.
Split jpg Samsung Gear 360 2017
#!/bin/bash
#place in a folder with gear 360 images, and it'll split them into the two images.
if [ ! -d "split" ]
then
mkdir split
fi
for i in *
do
if [[ $i == *.JPG ]]
then
new_file_name_l=$(sed 's/ /_/g' <<< "${i%.*}_l.jpg")
new_file_name_r=$(sed 's/ /_/g' <<< "${i%.*}_r.jpg")
convert "$i" -crop 2896x2896+0+0 "$new_file_name_l"
convert "$i" -crop 2896x2896+2896+0 "$new_file_name_r"
echo "$i split"
mv $i split/
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment