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
# pull official python alpine image | |
FROM python:3.7-alpine | |
# Set Environment Variable | |
ENV PYTHONUNBUFFERED 1 | |
ENV C_FORCE_ROOT true | |
# Making source and static directory | |
RUN mkdir /src | |
RUN mkdir /static |
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
def fill_page_with_image(path, canvas): | |
""" | |
Given the path to an image and a reportlab canvas, fill the current page | |
with the image. | |
This function takes into consideration EXIF orientation information (making | |
it compatible with photos taken from iOS devices). | |
This function makes use of ``canvas.setPageRotation()`` and | |
``canvas.setPageSize()`` which will affect subsequent pages, so be sure to |