App Engine Cropping to a Specific Width and Height
I need to resize and crop an image to a specific width and height. I was able to construct a method that will create a square thumbnail, but I'm unsure on how to apply this, when the desired thumbnail is not square. def rescale(data, width, height): """Rescale the given image, optionally cropping it to make sure the result image has the specified width and height.""" from google.appengine.api import images new_width = width new_height = height img = images.Image(data) org_width, org_height = img.width, img.height # We must determine if the image is portrait or landscape # Landscape if org