Merge pull request #1 from untainsYD/master

Windows compatibility and documentation fixes
This commit is contained in:
Mr. Stuzer 2021-10-17 12:39:19 -04:00 committed by GitHub
commit ec7db4a23c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 39 deletions

@ -14,7 +14,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
CC = convert ifeq ($(OS),Windows_NT)
CC = magick
else
CC = convert
endif
SOURCE ?= source.png SOURCE ?= source.png
# Files & forlders # Files & forlders
@ -105,46 +110,46 @@ all: $(SOURCE)
-mkdir $(DIST) $(dist_public) $(dist_icons) -mkdir $(DIST) $(dist_public) $(dist_icons)
@echo "Generating.. Regular icons" @echo "Generating.. Regular icons"
@$(CC) $(SOURCE) -resize 16x16! $(dist_icons)favicon-16x16.png @$(CC) $(SOURCE) -resize 16x16 $(dist_icons)favicon-16x16.png
@$(CC) $(SOURCE) -resize 32x32! $(dist_icons)favicon-32x32.png @$(CC) $(SOURCE) -resize 32x32 $(dist_icons)favicon-32x32.png
@$(CC) $(SOURCE) -resize 48x48! $(dist_icons)favicon-48x48.png @$(CC) $(SOURCE) -resize 48x48 $(dist_icons)favicon-48x48.png
@$(CC) $(SOURCE) -resize 57x57! $(dist_icons)favicon-57x57.png @$(CC) $(SOURCE) -resize 57x57 $(dist_icons)favicon-57x57.png
@$(CC) $(SOURCE) -resize 76x76! $(dist_icons)favicon-76x76.png @$(CC) $(SOURCE) -resize 76x76 $(dist_icons)favicon-76x76.png
@$(CC) $(SOURCE) -resize 96x96! $(dist_icons)favicon-96x96.png @$(CC) $(SOURCE) -resize 96x96 $(dist_icons)favicon-96x96.png
@$(CC) $(SOURCE) -resize 128x128! $(dist_icons)favicon-128x128.png @$(CC) $(SOURCE) -resize 128x128 $(dist_icons)favicon-128x128.png
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)favicon-192x192.png @$(CC) $(SOURCE) -resize 192x192 $(dist_icons)favicon-192x192.png
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)favicon-196x196.png @$(CC) $(SOURCE) -resize 192x192 $(dist_icons)favicon-196x196.png
@$(CC) $(SOURCE) -resize 228x228! $(dist_icons)favicon-228x228.png @$(CC) $(SOURCE) -resize 228x228 $(dist_icons)favicon-228x228.png
@echo "Packing.. triple-sized favicon.ico" @echo "Packing.. triple-sized favicon.ico"
@$(CC) $(dist_icons)favicon-16x16.png $(dist_icons)favicon-32x32.png $(dist_icons)favicon-48x48.png $(dist_public)favicon.ico @$(CC) $(dist_icons)favicon-16x16.png $(dist_icons)favicon-32x32.png $(dist_icons)favicon-48x48.png $(dist_public)favicon.ico
@echo "Generating.. Android icons" @echo "Generating.. Android icons"
@$(CC) $(SOURCE) -resize 196x196! $(dist_icons)favicon-196x196.png @$(CC) $(SOURCE) -resize 196x196 $(dist_icons)favicon-196x196.png
@$(CC) $(SOURCE) -resize 192x192! $(dist_icons)android-chrome-192x192.png @$(CC) $(SOURCE) -resize 192x192 $(dist_icons)android-chrome-192x192.png
@$(CC) $(SOURCE) -resize 196x196! $(dist_icons)android-chrome-512x512.png @$(CC) $(SOURCE) -resize 196x196 $(dist_icons)android-chrome-512x512.png
@echo "Generating.. Apple icons" @echo "Generating.. Apple icons"
@$(CC) $(SOURCE) -resize 57x57! $(dist_icons)apple-touch-icon-57x57.png @$(CC) $(SOURCE) -resize 57x57 $(dist_icons)apple-touch-icon-57x57.png
@$(CC) $(SOURCE) -resize 114x114! $(dist_icons)apple-touch-icon-114x114.png @$(CC) $(SOURCE) -resize 114x114 $(dist_icons)apple-touch-icon-114x114.png
@$(CC) $(SOURCE) -resize 72x72! $(dist_icons)apple-touch-icon-72x72.png @$(CC) $(SOURCE) -resize 72x72 $(dist_icons)apple-touch-icon-72x72.png
@$(CC) $(SOURCE) -resize 144x144! $(dist_icons)apple-touch-icon-144x144.png @$(CC) $(SOURCE) -resize 144x144 $(dist_icons)apple-touch-icon-144x144.png
@$(CC) $(SOURCE) -resize 60x60! $(dist_icons)apple-touch-icon-60x60.png @$(CC) $(SOURCE) -resize 60x60 $(dist_icons)apple-touch-icon-60x60.png
@$(CC) $(SOURCE) -resize 120x120! $(dist_icons)apple-touch-icon-120x120.png @$(CC) $(SOURCE) -resize 120x120 $(dist_icons)apple-touch-icon-120x120.png
@$(CC) $(SOURCE) -resize 76x76! $(dist_icons)apple-touch-icon-76x76.png @$(CC) $(SOURCE) -resize 76x76 $(dist_icons)apple-touch-icon-76x76.png
@$(CC) $(SOURCE) -resize 152x152! $(dist_icons)apple-touch-icon-152x152.png @$(CC) $(SOURCE) -resize 152x152 $(dist_icons)apple-touch-icon-152x152.png
@$(CC) $(SOURCE) -resize 180x180! $(dist_icons)apple-touch-icon.png @$(CC) $(SOURCE) -resize 180x180 $(dist_icons)apple-touch-icon.png
@$(CC) $(SOURCE) -resize 180x180! $(dist_public)apple-touch-icon.png @$(CC) $(SOURCE) -resize 180x180 $(dist_public)apple-touch-icon.png
@$(CC) $(SOURCE) -resize 180x180! -quality 80% $(dist_public)apple-touch-icon-precomposed.png @$(CC) $(SOURCE) -resize 180x180 -quality 80% $(dist_public)apple-touch-icon-precomposed.png
@echo "Generating.. IE 10 Metro tile icons" @echo "Generating.. IE 10 Metro tile icons"
@$(CC) $(SOURCE) -resize 144x144! $(dist_icons)mstile-144x144.png @$(CC) $(SOURCE) -resize 144x144 $(dist_icons)mstile-144x144.png
@echo "Generating.. IE 11 Metro tile for Windows 8.1 start screen" @echo "Generating.. IE 11 Metro tile for Windows 8.1 start screen"
@$(CC) $(SOURCE) -resize 70x70! $(dist_icons)mstile-small.png @$(CC) $(SOURCE) -resize 70x70 $(dist_icons)mstile-small.png
@$(CC) $(SOURCE) -resize 150x150! $(dist_icons)mstile-medium.png @$(CC) $(SOURCE) -resize 150x150 $(dist_icons)mstile-medium.png
@$(CC) $(SOURCE) -resize 310x150! $(dist_icons)mstile-wide.png @$(CC) $(SOURCE) -resize 310x150 $(dist_icons)mstile-wide.png
@$(CC) $(SOURCE) -resize 310x310! $(dist_icons)mstile-large.png @$(CC) $(SOURCE) -resize 310x310 $(dist_icons)mstile-large.png
@echo "Generating.. manifest.json" @echo "Generating.. manifest.json"
$(file_manifest) $(file_manifest)
@ -159,4 +164,4 @@ all: $(SOURCE)
.PHONY: clean .PHONY: clean
clean: clean:
$(RM) -r $(DIST)* $(subst /,,$(DIST)) $(RM) -r $(DIST)* $(subst /,,$(DIST))

@ -2,12 +2,12 @@
Generates all necessary favicons for your website. Generates all necessary favicons for your website.
This includes iOS Safari, Google Chrome, Mozilla Firefox, Windows 8 and 10, and possibly some other browsers. This includes iOS Safari, Google Chrome, Mozilla Firefox, Windows 8 and 10, and possibly some other browsers.
# Getting Started ## Getting Started
To get started with favicon generator you need to make sure [ImageMagick](https://imagemagick.org/index.php) and the latest [GNU make](https://www.gnu.org/software/make/) software are installed and present in your PATH environment variable. To get started with favicon generator you need to make sure [ImageMagick](https://imagemagick.org/index.php) and the latest [GNU make](https://www.gnu.org/software/make/) software are installed and present in your PATH environment variable.
# Configuration ## Configuration
By default, makefile uses `convert` file of ImageMagick software, but you can change that by specifying a new name as a parameter for make By default, makefile uses `convert` file of ImageMagick software, but you can change that by specifying a new name as a parameter for make
``` ```make
make CC=<executable name> make CC=<executable name>
``` ```
or by changing the following line in a makefile or by changing the following line in a makefile
@ -17,14 +17,14 @@ CC = magick
Also, the default image filename make is looking for is `source.png`, and you can change that either passing the new filename as a parameter Also, the default image filename make is looking for is `source.png`, and you can change that either passing the new filename as a parameter
``` ```
make FILE=<image filename> make SOURCE=<image filename>
``` ```
or by changing the following line or by changing the following line
``` ```
FILE ?= <image filename> SOURCE ?= <image filename>
``` ```
# Using bash ## Using bash
You use bash script `generate.sh` to use the program anywhere on your system. First of, you have to create a symbolic link to an executable using the following command You use bash script `generate.sh` to use the program anywhere on your system. First of, you have to create a symbolic link to an executable using the following command
```bash ```bash
$ ln -s <path to program>/generate.sh ~/.local/bin/webicongen $ ln -s <path to program>/generate.sh ~/.local/bin/webicongen
@ -36,7 +36,7 @@ $ webicongen <image> <output dir>
``` ```
The output directory will be created automatically. The output directory will be created automatically.
# Usage ## Usage
After everything is configured, simply place your image in the same directory as makefile, and then simply run `make`. It will generate the following directory structure After everything is configured, simply place your image in the same directory as makefile, and then simply run `make`. It will generate the following directory structure
``` ```
dist/ dist/
@ -79,7 +79,9 @@ dist/
`public` folder must be the same as your project's public folder, you can simply copy-paste it into your project (make sure you don't have one of these generated files already in your project, such as `manifest.json`). `public` folder must be the same as your project's public folder, you can simply copy-paste it into your project (make sure you don't have one of these generated files already in your project, such as `manifest.json`).
# Acknowledgements ---
## Acknowledgements
I would love to hear any ideas or issues regarding this makefile. Make sure to create an issue or a pull request. I would love to hear any ideas or issues regarding this makefile. Make sure to create an issue or a pull request.
You can also send me an email to stuzer05 at gmail.com You can also send me an email to stuzer05 at gmail.com