File size: 321 Bytes
be5548b
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash


# Loop through all files in the specified directory
for file in "$@"
do
  # Check if the file is an image
  if [[ $file == *.jpg || $file == *.png ]]
  then
    # Crop the image using the `convert` command from the ImageMagick suite
    echo "Cropping $file"
    convert $file -trim +repage $file
  fi
done