2022-03-03 20:54:51 +01:00
|
|
|
FULLPICS = $(shell find full -name '*.jpg')
|
2022-02-03 13:14:38 +01:00
|
|
|
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-03-03 20:54:51 +01:00
|
|
|
thumb/%.jpg: full/%.jpg
|
|
|
|
mkdir -p "$$(dirname "$@")"
|
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)
|