2
0
MasterPassword/Scripts/convertImages

35 lines
711 B
Plaintext
Raw Normal View History

2012-01-12 16:28:20 +00:00
#! /usr/bin/env bash
source bashlib
shopt -s nullglob
emit "Converting iTunesArtwork"
icons=(
[29]="Icon-Small.png"
[50]="Icon-Small-50.png"
[58]="Icon-Small@2x.png"
[57]="Icon.png"
[72]="Icon-72.png"
[114]="Icon@2x.png"
)
2012-02-03 07:45:09 +00:00
cd "${0%/*}/../MasterPassword/Resources"
2012-01-12 16:28:20 +00:00
for size in "${!icons[@]}"; do
file=${icons[size]}
emit "$file ($size px)" --
convert "iTunesArtwork.png" -resize "${size}x${size}" "$file"
emit -$?
done
echo
emit "Converting @2x artwork"
2012-02-02 13:56:09 +00:00
for file in ./{,Guide/}*@2x.png; do
2012-01-16 08:51:08 +00:00
inArray "${file##*/}" "${icons[@]}" && continue
2012-01-12 16:28:20 +00:00
emit "${file/@2x}" --
2012-01-16 08:51:08 +00:00
convert "$file" -filter box -resize 50% -unsharp 0x1 "${file/@2x}"
2012-01-12 16:28:20 +00:00
emit -$?
done