add 20pt icon and use GraphicsMagick instead of ImageMagick

This commit is contained in:
Sami Samhuri 2017-06-20 14:58:55 -07:00
parent aa92a39f15
commit 410c331ba6
No known key found for this signature in database
GPG key ID: F76F41F04D99808F
2 changed files with 5 additions and 4 deletions

View file

@ -12,12 +12,12 @@ def scale_retina(width, height, scale, in_file, out_dir, prefix)
filename = "#{prefix}#{file_scale}.png" filename = "#{prefix}#{file_scale}.png"
out_file = File.join(out_dir, filename) out_file = File.join(out_dir, filename)
puts "> convert '#{in_file}' -scale #{width * scale}x#{height * scale} '#{out_file}'" puts "> convert '#{in_file}' -scale #{width * scale}x#{height * scale} '#{out_file}'"
output = `convert '#{in_file}' -scale #{width * scale}x#{height * scale} '#{out_file}'`.strip output = `gm convert '#{in_file}' -scale #{width * scale}x#{height * scale} '#{out_file}'`.strip
puts output if output.length > 0 puts output if output.length > 0
end end
def image_dimensions(path) def image_dimensions(path)
`identify '#{path}'`.split[2].split('x').map(&:to_i) `gm identify '#{path}'`.split[2].split('x').map(&:to_i)
end end
in_file, out_dir, prefix, raw_width, raw_height = ARGV in_file, out_dir, prefix, raw_width, raw_height = ARGV

View file

@ -19,8 +19,9 @@ if [[ ! -d "$OUT_DIR" ]]; then
exit 2 exit 2
fi fi
for SIZE in 29 40 60 76 83.5; do for SIZE in 20 29 40 60 76 83.5; do
PREFIX="${IN_FILE%.png}_$SIZE" FILENAME=$(basename "$IN_FILE")
PREFIX="${FILENAME%.png}_$SIZE"
echo "* Generating app icons at $SIZE points with filename prefix $PREFIX" echo "* Generating app icons at $SIZE points with filename prefix $PREFIX"
retina-scale "$IN_FILE" "$OUT_DIR" "$PREFIX" $SIZE $SIZE retina-scale "$IN_FILE" "$OUT_DIR" "$PREFIX" $SIZE $SIZE
done done