This file contains 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
FROM node:14.2.0-alpine3.10 | |
WORKDIR /app | |
ENV PATH /app/node_modules/.bin:$PATH | |
COPY package.json ./ | |
RUN yarn install --production --silent |
This file contains 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
#run this in any directory with the max width parameter add -v for verbose | |
#image will be scalled in proportion to confine within the max width parameter | |
#this allows you to get images that are within a box dimension for online publishing (i.e. 400x400) without distorting the image | |
#get Pillow (fork of PIL) from pip before running --> pip install Pillow | |
#regarding timing: 42 seconds for 4938 so max 15 minutes for 100,000 images | |
import os |
This file contains 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
#run this in any directory add -v for verbose | |
#get Pillow (fork of PIL) from pip before running --> pip install Pillow | |
import os | |
import sys | |
from PIL import Image | |
def compressMe(file, verbose=False): | |
filepath = os.path.join(os.getcwd(), file) | |
oldsize = os.stat(filepath).st_size |