2022-02-03 13:14:38 +01:00
|
|
|
FULLPICS = $(wildcard full/*.jpg)
|
|
|
|
THUMBS = $(patsubst full/%.jpg,thumb/%.jpg,$(FULLPICS))
|
|
|
|
|
|
|
|
THUMB_DIM = 400
|
|
|
|
THUMB_ASPECT_RATIO = 1:1
|
|
|
|
CONVERT_OPTIONS = -quality 75 -strip -interlace Plane +repage
|
|
|
|
|
|
|
|
all: $(THUMBS)
|
|
|
|
|
2022-02-03 13:17:25 +01:00
|
|
|
thumb:
|
|
|
|
mkdir -p thumb
|
|
|
|
|
|
|
|
thumb/%.jpg: full/%.jpg thumb
|
2022-02-03 13:14:38 +01:00
|
|
|
convert "$<" \
|
|
|
|
-resize '$(THUMB_DIM)x$(THUMB_DIM)^' \
|
|
|
|
-gravity "$$(./gravityof.sh "$<")" \
|
|
|
|
-crop "$(THUMB_ASPECT_RATIO)" \
|
|
|
|
$(CONVERT_OPTIONS) "$@"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(THUMBS)
|