Created
August 24, 2014 23:33
-
-
Save martinemmert/9ce7eb2c6799ec69304c to your computer and use it in GitHub Desktop.
Bash script to downsize @2x.* images in the current directory...
This file contains 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 | |
#simple script to downsize @2x.* images to maxWH 1024 in one folder | |
## create the directory to keep the lowres files | |
mkdir lowres | |
## downsize all images with @2x in the filename | |
sips -Z 1024 *@2x* --out lowres | |
## switch into the directory where the lowres files are stored | |
cd lowres | |
## remove the @2x from the filename | |
for i in *@2x.*; do | |
mv "$i" "${i/@2x/}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment