[英]What is the best way to store images in App Engine Blob Storage?
I need to store images in two sizes: 我需要以两种尺寸存储图像:
1.Thumbnail (100x200px). 1.缩略图(100x200px)。
2. Big image (1024x2048). 2.大图片(1024x2048)。
There are few options of storage: 存储方式很少:
a) Save original image than resize it dynamically when page is loading by using "Image Manipulation API". a)保存原始图像,而不是使用“ Image Manipulation API”在页面加载时动态调整其大小。
b) Resize original image by "Image Manipulation API" than save two copies in different resolutions. b)通过“ Image Manipulation API”调整原始图像的大小,然后以不同的分辨率保存两个副本。
It seems to me that option a) is using lots of "Frontend Instance Hours". 在我看来,选项a)使用了很多“前端实例时间”。 But I don't found any information about how to make option b) work. 但是我没有找到任何有关如何使选项b)工作的信息。
You can get it for free using the getServingUrl API. 您可以使用getServingUrl API免费获得它。
You upload the image to the blobstore and pass the user a url with the resize params. 您将图像上传到Blobstore,并向用户传递了带有调整大小参数的URL。
The backend will resize the image for you in runtime and save a cached version, you will only pay for the bandwidth. 后端将在运行时为您调整图像大小并保存缓存的版本,您只需为带宽付费。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.