Skip to content

Commit

Permalink
Replace deprecated imagemagick invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jun 10, 2024
1 parent 1ce4ad1 commit 49594b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ PRINTER_IMGS := $(addprefix build/controls-engineering-in-frc-printer/,$(wildcar
SNIPPETS := $(wildcard snippets/*)

ifeq ($(OS),Windows_NT)
CONVERT := magick convert
VENV_PYTHON := ./build/venv/Scripts/python3
VENV_PIP := ./build/venv/Scripts/pip3
else
CONVERT := convert
VENV_PYTHON := ./build/venv/bin/python3
VENV_PIP := ./build/venv/bin/pip3
endif
Expand Down Expand Up @@ -59,9 +57,9 @@ $(EBOOK_IMGS): build/controls-engineering-in-frc-ebook/%.jpg: %.jpg
# cover: 4032x2016 -> 150dpi * 8.5" x 150dpi * 11" -> 1275x1650
# banners: 4032x2016 -> 150dpi * 8.5" x 150dpi * 4.25" -> 1275x637
if [ "$<" = "imgs/cover.jpg" ]; then \
$(CONVERT) "$<" -resize 1275x1650 -quality 75 "$@"; \
magick "$<" -resize 1275x1650 -quality 75 "$@"; \
else \
$(CONVERT) "$<" -resize 1275x637 -quality 75 "$@"; \
magick "$<" -resize 1275x637 -quality 75 "$@"; \
fi

$(PRINTER_IMGS): build/controls-engineering-in-frc-printer/%.jpg: %.jpg
Expand All @@ -70,9 +68,9 @@ $(PRINTER_IMGS): build/controls-engineering-in-frc-printer/%.jpg: %.jpg
# cover: 4032x2016 -> 300dpi * 8.5" x 300dpi * 11" -> 2550x3300
# banners: 4032x2016 -> 300dpi * 8.5" x 300dpi * 4.25" -> 2550x1275
if [ "$<" = "imgs/cover.jpg" ]; then \
$(CONVERT) "$<" -resize 2550x3300 -quality 95 "$@"; \
magick "$<" -resize 2550x3300 -quality 95 "$@"; \
else \
$(CONVERT) "$<" -resize 2550x1275 -quality 95 "$@"; \
magick "$<" -resize 2550x1275 -quality 95 "$@"; \
fi

build/commit-date.tex: .git/refs/heads/$(shell git rev-parse --abbrev-ref HEAD) .git/HEAD
Expand Down

0 comments on commit 49594b2

Please sign in to comment.