Last active
March 11, 2018 21:54
-
-
Save dmsnell/40a754ce570395aeec3c3f639441173c to your computer and use it in GitHub Desktop.
Build output images from Lightroom exports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| output-jpgs = $(addprefix $1/,$(subst .tif,.jpg,$(wildcard *.tif))) | |
| # $(call transform,quality,convert-args,optim-args) | |
| define transform | |
| convert $< -quality 98 $2 $@ && \ | |
| jpegoptim $@ -m$1 --all-progressive $3 | |
| endef | |
| all: small-jpgs medium-jpgs large-jpgs | |
| small-jpgs: $(call output-jpgs,small) | |
| medium-jpgs: $(call output-jpgs,medium) | |
| large-jpgs: $(call output-jpgs,large) | |
| small/%.jpg: %.tif | small | |
| $(call transform,87,-resize 1200x,-s) | |
| medium/%.jpg: %.tif | medium | |
| $(call transform,87,-resize 50% -filter box,-s) | |
| large/%.jpg: %.tif | large | |
| $(call transform,90,,) | |
| small medium large: | |
| mkdir -p $@ | |
| clean: | |
| rm -rf small medium large | |
| clean-tifs: | |
| rm *.tif | |
| # Reset implicit rules | |
| .SUFFIXES: | |
| MAKEFLAGS += --no-builtin-rules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment