使用Google App Engine图片的清晰示例get_serving_url() [英] Clear example of using Google App Engine Images get_serving_url()

查看:325
本文介绍了使用Google App Engine图片的清晰示例get_serving_url()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道这个例子吗?我无法在Google的文档中找到一个.

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

推荐答案

get_serving_url已记录在此处.本身并没有端到端示例,但它非常简单:您将其传递给Blob键以及可选的调整大小和裁剪选项,并为您提供URL.您可以在要引用图像的任何地方使用该URL,基础结构将对其提供服务,并对其进行适当的调整和裁剪.

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.

请注意,这仅适用于上传到Blobstore的图像.上传到常规数据存储区并存储在BlobProperty中的所有内容都必须调整大小,裁剪并为自己服务.

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.

这篇关于使用Google App Engine图片的清晰示例get_serving_url()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆