File: convert-svg.sh

package info (click to toggle)
kadu 4.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,532 kB
  • sloc: cpp: 128,331; sh: 988; awk: 105; makefile: 75
file content (15 lines) | stat: -rwxr-xr-x 353 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

sizes="16 22 32 48 64 96"

for svg_file in `find -name "*.svg"`; do
	echo "Converting $svg_file ..."
	for size in $sizes; do
		with_size=${svg_file/svg/${size}x${size}}
		png_file=${with_size/.svg/.png}
		dir=$(dirname $png_file)
		mkdir -p $dir
		echo "... to $png_file"
		rsvg-convert $svg_file -w $size -h $size -o $png_file
	done
done;