summaryrefslogtreecommitdiff
path: root/app/images/icons/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'app/images/icons/Makefile')
-rw-r--r--app/images/icons/Makefile68
1 files changed, 34 insertions, 34 deletions
diff --git a/app/images/icons/Makefile b/app/images/icons/Makefile
index be564b4..03eaed0 100644
--- a/app/images/icons/Makefile
+++ b/app/images/icons/Makefile
@@ -1,42 +1,42 @@
-ICONS := \
- novnc-16x16.png \
- novnc-24x24.png \
- novnc-32x32.png \
- novnc-48x48.png \
- novnc-64x64.png
-
-ANDROID_LAUNCHER := \
- novnc-48x48.png \
- novnc-72x72.png \
- novnc-96x96.png \
- novnc-144x144.png \
- novnc-192x192.png
-
-IPHONE_LAUNCHER := \
- novnc-60x60.png \
- novnc-120x120.png
-
-IPAD_LAUNCHER := \
- novnc-76x76.png \
- novnc-152x152.png
-
-ALL_ICONS := $(ICONS) $(ANDROID_LAUNCHER) $(IPHONE_LAUNCHER) $(IPAD_LAUNCHER)
+BROWSER_SIZES := 16 24 32 48 64
+#ANDROID_SIZES := 72 96 144 192
+# FIXME: The ICO is limited to 8 icons due to a Chrome bug:
+# https://bugs.chromium.org/p/chromium/issues/detail?id=1381393
+ANDROID_SIZES := 96 144 192
+WEB_ICON_SIZES := $(BROWSER_SIZES) $(ANDROID_SIZES)
+
+#IOS_1X_SIZES := 20 29 40 76 # No such devices exist anymore
+IOS_2X_SIZES := 40 58 80 120 152 167
+IOS_3X_SIZES := 60 87 120 180
+ALL_IOS_SIZES := $(IOS_1X_SIZES) $(IOS_2X_SIZES) $(IOS_3X_SIZES)
+
+ALL_ICONS := \
+ $(ALL_IOS_SIZES:%=novnc-ios-%.png) \
+ novnc.ico
all: $(ALL_ICONS)
-novnc-16x16.png: novnc-icon-sm.svg
- convert -density 90 \
- -background transparent "$<" "$@"
-novnc-24x24.png: novnc-icon-sm.svg
- convert -density 135 \
- -background transparent "$<" "$@"
-novnc-32x32.png: novnc-icon-sm.svg
- convert -density 180 \
- -background transparent "$<" "$@"
+# Our testing shows that the ICO file need to be sorted in largest to
+# smallest to get the apporpriate behviour
+WEB_ICON_SIZES_REVERSE := $(shell echo $(WEB_ICON_SIZES) | tr ' ' '\n' | sort -nr | tr '\n' ' ')
+WEB_BASE_ICONS := $(WEB_ICON_SIZES_REVERSE:%=novnc-%.png)
+.INTERMEDIATE: $(WEB_BASE_ICONS)
+novnc.ico: $(WEB_BASE_ICONS)
+ convert $(WEB_BASE_ICONS) "$@"
+
+# General conversion
novnc-%.png: novnc-icon.svg
- convert -density $$[`echo $* | cut -d x -f 1` * 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$* "$(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