Skip to content

Instantly share code, notes, and snippets.

Avatar

iury IuryAlves

View GitHub Profile
@IuryAlves
IuryAlves / compress_s3_images.py
Created Feb 22, 2017 — forked from rigoneri/compress_s3_images.py
Simple python code to compress (jpeg/png) images uploaded to S3. In this use case I want to compress down all images that are over 500 KB down to 80% quality which brings the images down to about 100KB. Feel free to muck with the values.
View compress_s3_images.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from boto.s3.connection import S3Connection
from cStringIO import StringIO
from PIL import Image as pil
AWS_KEY = '[AWS KEY HERE]'
You can’t perform that action at this time.