diff options
author | silverwind <me@silverwind.io> | 2020-07-26 11:47:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 17:47:51 +0800 |
commit | 7cf23399a0b97cb8211e8e7b00020e9b1a5fdac1 (patch) | |
tree | a517c074455b1fcaf2eaf0373c059e31f1333ba9 /Makefile | |
parent | ea1ed802a308698f6b30dd695d0b97251d552775 (diff) | |
download | gitea-7cf23399a0b97cb8211e8e7b00020e9b1a5fdac1.tar.gz gitea-7cf23399a0b97cb8211e8e7b00020e9b1a5fdac1.zip |
Rework 'make generate-images' (#12316)
* Rework 'make generate-images'
- Remove external dependencies and replace it with a node script that
does does the same.
- Move detail removal from gitea-sm.png to favicon.png
- Remove favicon.ico and its generation, it is unused and we already serve
favicon.png in its place.
Fixes: https://github.com/go-gitea/gitea/issues/12314
* use proper centering value for preserveAspectRatio
* fix lint
* use fabric
* better linting fix
* fix typo
* mention detail-remove class in docs
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 2 insertions, 28 deletions
@@ -648,34 +648,8 @@ update-translations: .PHONY: generate-images generate-images: - $(eval TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp')) - mkdir -p $(TMPDIR)/images - inkscape -f $(PWD)/assets/logo.svg -w 880 -h 880 -e $(PWD)/public/img/gitea-lg.png - inkscape -f $(PWD)/assets/logo.svg -w 512 -h 512 -e $(PWD)/public/img/gitea-512.png - inkscape -f $(PWD)/assets/logo.svg -w 192 -h 192 -e $(PWD)/public/img/gitea-192.png - inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer1 -e $(TMPDIR)/images/sm-1.png - inkscape -f $(PWD)/assets/logo.svg -w 120 -h 120 -jC -i layer2 -e $(TMPDIR)/images/sm-2.png - composite -compose atop $(TMPDIR)/images/sm-2.png $(TMPDIR)/images/sm-1.png $(PWD)/public/img/gitea-sm.png - inkscape -f $(PWD)/assets/logo.svg -w 200 -h 200 -e $(PWD)/public/img/avatar_default.png - inkscape -f $(PWD)/assets/logo.svg -w 180 -h 180 -e $(PWD)/public/img/favicon.png - inkscape -f $(PWD)/assets/logo.svg -w 128 -h 128 -e $(TMPDIR)/images/128-raw.png - inkscape -f $(PWD)/assets/logo.svg -w 64 -h 64 -e $(TMPDIR)/images/64-raw.png - inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer1 -e $(TMPDIR)/images/32-1.png - inkscape -f $(PWD)/assets/logo.svg -w 32 -h 32 -jC -i layer2 -e $(TMPDIR)/images/32-2.png - composite -compose atop $(TMPDIR)/images/32-2.png $(TMPDIR)/images/32-1.png $(TMPDIR)/images/32-raw.png - inkscape -f $(PWD)/assets/logo.svg -w 16 -h 16 -jC -i layer1 -e $(TMPDIR)/images/16-raw.png - zopflipng -m -y $(TMPDIR)/images/128-raw.png $(TMPDIR)/images/128.png - zopflipng -m -y $(TMPDIR)/images/64-raw.png $(TMPDIR)/images/64.png - zopflipng -m -y $(TMPDIR)/images/32-raw.png $(TMPDIR)/images/32.png - zopflipng -m -y $(TMPDIR)/images/16-raw.png $(TMPDIR)/images/16.png - rm -f $(TMPDIR)/images/*-*.png - convert $(TMPDIR)/images/16.png $(TMPDIR)/images/32.png \ - $(TMPDIR)/images/64.png $(TMPDIR)/images/128.png \ - $(PWD)/public/img/favicon.ico - convert -flatten $(PWD)/public/img/favicon.png $(PWD)/public/img/apple-touch-icon.png - - rm -rf $(TMPDIR)/images - $(foreach file, $(shell find public/img -type f -name '*.png' ! -name 'loading.png'),zopflipng -m -y $(file) $(file);) + npm install --no-save --no-package-lock xmldom fabric imagemin-zopfli + node build/generate-images.js .PHONY: pr\#% pr\#%: clean-all |