File: optimize-images

package info (click to toggle)
josm 0.0.svn5267%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 153,404 kB
  • sloc: java: 152,210; xml: 8,902; perl: 1,346; makefile: 64; sh: 35
file content (15 lines) | stat: -rwxr-xr-x 443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

for x in $(find images/ -name "*.png"); do
	echo "Processing ${x}"
	identify -quiet -verbose "${x}" | grep "alpha: 1-bit" > /dev/null
	if [ "$?" -ne "0" ]; then
		# non-1-bit-alpha image, process normally
		optipng -o7 -quiet "${x}"
	else
		# disable color type reduction because that will break
		# transparency for the images in JOSM using the current
		# image loading method (see #1576)
		optipng -nc -o7 -quiet "${x}"
	fi
done