12345678910111213141516171819202122232425262728293031323334353637 |
- #
- # Example
- #
- # $ make title='My Photos' base='https://example.com/sub/my-photos'
- #
- # See http://purl.mro.name/Photos2Atom
- #
- .PHONY: all build clean large thumb
- _build/200/%: src/%
- @-mkdir -p _build/200
- @# https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/
- @# https://www.linuxquestions.org/questions/linux-software-2/question-about-thumbnail-orientation-dimensions-with-imagemagick-493034/
- convert $< -thumbnail 200x200 -auto-orient -quality 30% -strip -define png:exclude-chunk=all $@
- @touch -r "$<" "$@"
- _build/1200/%: src/%
- @-mkdir -p _build/1200
- convert $< -resize 1200x1200\> -auto-orient -quality 82% -strip -define png:exclude-chunk=all $@
- @touch -r "$<" "$@"
- build: thumb large _build/index.xml
- all: build
- clean:
- rm -rf _build
- SRC := $(wildcard src/*)
- thumb: $(patsubst src/%,_build/200/%,${SRC})
- large: $(patsubst src/%,_build/1200/%,${SRC})
- _build/index.xml: ${SRC}
- sh ./atom.sh '$(title)' '$(base)' $^ > $@
|