The bounding box crop is only provided by Image.crop(left, top, right, bottom) <https://cloud.google.com/appengine/docs/python/refdocs/google.appengine.api.images#google.appengine.api.images.Image.crop>, so you'd need to do this from within your own handler and serve the cropped image back. The URL returned by get_serving_url only accepts one argument for the longest side length.
A complete example of how to load an image from the Datastore and transform it is provided in the docs <https://cloud.google.com/appengine/docs/python/images/#Python_Transforming_images_in_Python>. The transform and response code in your handler would look something like the following: img = images.Image(photo.full_size_image) img.crop(left, top, right, bottom) thumbnail = img.execute_transforms(output_encoding=images.JPEG) self.response.headers['Content-Type'] = 'image/jpeg' self.response.out.write(thumbnail) On Monday, June 13, 2016 at 12:22:57 PM UTC-4, Handerson Contreras wrote: > > Hello Everybody > > I have a problem trying to crop images in GAE. > > I'm using the Images API and adding parameters to the Url created by > > images.get_serving_url(key, size=None, crop=False, secure_url=None) > method, but i need to crop with a given bounding box. > > Do you know if this is possible by using get_serving_url method? > > or maybe you can give me another suggestion. > > Thanks > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/27e4aa31-27c0-4ee4-945c-9eb0818cafe3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
