google-app-engineimage-processinggoogle-cloud-platformblobstore

Clear example of using Google App Engine Images get_serving_url()


Anybody know of an example of this? I haven't been able to find one in Google's documentation.


Solution

  • get_serving_url is documented here. There's no end-to-end example per-se, but it's pretty straightforward: You pass it a blob key, along with optional resize and crop options, and it gives you back a URL. You can use that URL anywhere you want to reference the image, and it'll be served up by the infrastructure, resized and cropped appropriately.

    Note that this is only for images uploaded to the blobstore. Anything uploaded to the regular datastore and stored in a BlobProperty you'll have to resize, crop, and serve yourself.