Skip to content

Instantly share code, notes, and snippets.

@dkasper
Last active August 29, 2015 13:56
Show Gist options
  • Save dkasper/9219200 to your computer and use it in GitHub Desktop.
Save dkasper/9219200 to your computer and use it in GitHub Desktop.
Utility scripts for dealing with assets on iOS
#!/bin/bash
# This script assumes that ImageMagick is installed and the convert command is accessible\
# Create copies of all files in directory at 50% size (and names them without @2x)
for infile in *
do
outfile=$(echo $infile | sed -n "s/@2x//p")
test -z $outfile && continue
convert $infile -resize 50% $outfile
done
#!/bin/bash
#Rename all .png assets in a directory to @2x.png (since non-developers often don't know to name them that way)
rename 's/\.png/\@2x.png/' *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment