Skip to content

Instantly share code, notes, and snippets.

View guimou's full-sized avatar

Guillaume Moutier guimou

  • Red Hat
  • Québec, Canada
View GitHub Profile
@guimou
guimou / pil_s3.py
Created December 11, 2019 20:13 — forked from ghandic/pil_s3.py
Load image from S3 directly into memory as PIL image and write to S3 directly from memory from PIL image
import boto3
from PIL import Image
from io import BytesIO
import os
class S3ImagesInvalidExtension(Exception):
pass
class S3ImagesUploadFailed(Exception):
pass