Book Image

Python for Google App Engine

By : Massimiliano Pippi
Book Image

Python for Google App Engine

By: Massimiliano Pippi

Overview of this book

Table of Contents (15 chapters)
Python for Google App Engine
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Transforming images with the Images service


We already used the App Engine Images service to serve images through Google's CDN, but there's a lot more it can do. It can resize, rotate, flip, crop images, and composite multiple images into a single file. It can enhance pictures using a predefined algorithm. It can convert an image from and to several formats. The service can also provide information about an image, such as its format, width, height, and a histogram of color values.

Note

To use the Images service on the local development server, we need to download and install the Python Imaging Library (PIL) package or, alternatively, the pillow package.

We can pass the image data to the service directly from our application or specifying a resource stored in Cloud Storage. To see how this works, we add a function to our Notes application that users can trigger to shrink all the images attached to any note in order to save space in Cloud Storage. To do this, we add a dedicated request handler...