AWS lambda function for validating, cropping and re-scaling incoming images to fruktkartan.se.
cp .env.sample .env
python3 -m pip install -r requirements/dev.txt
The .env.sample
file contains defaults for the environment variables used. You need to set these variables somehow, e.g. by copying them to a .env
file.
You will also need to setup credentials for AWS S3 access (see https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html for various ways to do this)
Not that the requirements/prod.txt
file does not contain boto3
or Pillow
, as these are preinstalled in our production environment.
./resize.py --help
Tests are written for pytest. Linting can be done with flake8.
python3 -m flake8
python3 -m pytest
Test images, see description pages at Wikimedia Commons: