Explicitly specify icon size instead of density
Instead of calculating a density that we hope results in the correct size, we can specify what size we want. This is more robust and easier to understand. This also allows us to simplify the Makefile quite a bit. Note that Fedora's packaging of ImageMagick has a bug here: https://bugzilla.redhat.com/show_bug.cgi?id=2140018
|
@ -13,23 +13,18 @@ ALL_ICONS := \
|
|||
|
||||
all: $(ALL_ICONS)
|
||||
|
||||
novnc-16.png: novnc-icon-sm.svg
|
||||
convert -density 90 \
|
||||
-background transparent "$<" "$@"
|
||||
novnc-24.png: novnc-icon-sm.svg
|
||||
convert -density 135 \
|
||||
-background transparent "$<" "$@"
|
||||
novnc-32.png: novnc-icon-sm.svg
|
||||
convert -density 180 \
|
||||
-background transparent "$<" "$@"
|
||||
|
||||
# General conversion
|
||||
novnc-%.png: novnc-icon.svg
|
||||
convert -density $$[`echo $*` * 90 / 48] \
|
||||
-background transparent "$<" "$@"
|
||||
convert -depth 8 -background transparent \
|
||||
-size $*x$* "$(lastword $^)" "$@"
|
||||
|
||||
# iOS icons use their own SVG
|
||||
novnc-ios-%.png: novnc-ios-icon.svg
|
||||
convert -depth 8 -background transparent \
|
||||
-size $*x$* "$<" "$@"
|
||||
-size $*x$* "$(lastword $^)" "$@"
|
||||
|
||||
# The smallest sizes are generated using a different SVG
|
||||
novnc-16.png novnc-24.png novnc-32.png: novnc-icon-sm.svg
|
||||
|
||||
clean:
|
||||
rm -f *.png
|
||||
|
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 967 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1023 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.0 KiB |