Skip to content

Instantly share code, notes, and snippets.

@gingertom
gingertom / renamer.sh
Created February 26, 2013 12:26
Renames all the images in a folder to add @2x between the filename and the extension. Usage (run in the folder to affect): path/to/renamer/renamer.sh
#!/bin/sh -e
cd "${1-.}"
for f in *; do
mv "$f" "${f%.*}@2x.${f##*.}"
done
@gingertom
gingertom / resizer.sh
Created February 26, 2013 12:22
Simple image magic script to go through a folder of @2x images and make non-retina copies of them too. Usage (run in folder to affect): path/to/resizer/resizer.sh
#!/bin/bash -e
cd "${1-.}"
for f in *; do
if [[ $f == *@2x* ]];
then
convert $f -resize 50% ${f//@2x/}
fi
done