Created
October 17, 2021 20:39
-
-
Save greg-randall/61813bea6a3907304541a4a01cbd4dd7 to your computer and use it in GitHub Desktop.
Split jpg Samsung Gear 360 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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