Created
December 23, 2014 20:24
-
-
Save dagezi/194c9972ca5ca36dd2db to your computer and use it in GitHub Desktop.
Generate debug icons with batch.
This file contains hidden or 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 | |
# all coordinate specified by percentage | |
x=75 | |
y=75 | |
w=12 | |
h=12 | |
color=yellow | |
icons=`cd src/main;echo res/*-*dpi/ic_launcher.png` | |
for icon in $icons | |
do | |
size=`identify src/main/$icon |sed 's/.*[0-9]x\([0-9][0-9]*\).*/\1/'` | |
x0=$(( $size * $x / 100 )) | |
y0=$(( $size * $y / 100)) | |
x1=$(( $size * ( $x + $w ) / 100)) | |
y1=$(( $size * ( $y + $h ) / 100)) | |
mkdir -p src/debug/$icon:h | |
convert src/main/$icon -fill $color -draw "rectangle $x0,$y0 $x1,$y1" src/debug/$icon | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment