Skip to content

fruktkartan/image-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS lambda function for validating, cropping and re-scaling incoming images to fruktkartan.se.

Installation

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.

Running

./resize.py --help

Testing

Tests are written for pytest. Linting can be done with flake8.

python3 -m flake8
python3 -m pytest

Licences

Test images, see description pages at Wikimedia Commons:

About

AWS Lambda function for resizing user-submitted images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages