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
This commit is contained in:
Samuel Mannehed 2022-12-22 16:14:11 +01:00
parent 416e21151b
commit 139f087187
10 changed files with 8 additions and 13 deletions

View File

@ -13,23 +13,18 @@ ALL_ICONS := \
all: $(ALL_ICONS) all: $(ALL_ICONS)
novnc-16.png: novnc-icon-sm.svg # General conversion
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 "$<" "$@"
novnc-%.png: novnc-icon.svg novnc-%.png: novnc-icon.svg
convert -density $$[`echo $*` * 90 / 48] \ convert -depth 8 -background transparent \
-background transparent "$<" "$@" -size $*x$* "$(lastword $^)" "$@"
# iOS icons use their own SVG
novnc-ios-%.png: novnc-ios-icon.svg novnc-ios-%.png: novnc-ios-icon.svg
convert -depth 8 -background transparent \ 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: clean:
rm -f *.png rm -f *.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB