Created
July 22, 2015 20:05
-
-
Save omsai/bb23b993b937addafbd3 to your computer and use it in GitHub Desktop.
Create center cropped thumbnail images
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
# Create thumbnails in another directory. Center resize and crop | |
# images to 150x150. | |
OBJDIR := ../tabs-square | |
IMG_SRC := $(wildcard *.jpg) | |
OBJS := $(addprefix $(OBJDIR)/,$(IMG_SRC)) | |
$(OBJDIR)/%.jpg : %.jpg | |
convert \ | |
$< \ | |
-resize 150 \ | |
-gravity center \ | |
-crop 150x150+0+0 \ | |
$@ | |
all : $(OBJS) | |
$(OBJS) : | $(OBJDIR) | |
$(OBJDIR) : | |
mkdir $(OBJDIR) | |
.PHONY : clean | |
clean: | |
rm -f $(OBJDIR)/*.jpg | |
.PHONY : variables | |
variables: | |
@echo Sources: $(IMG_SRC) | |
@echo Target Directory: $(OBJDIR) | |
@echo Targets: $(OBJS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment