从Google云存储获取调整大小的图像 [英] Get resized images from Google cloud storage

查看:101
本文介绍了从Google云存储获取调整大小的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最初加载我的网站时,我需要从用户上传的Google云存储中加载几张图像.为了加快加载时间,我想以较低的分辨率获取图像.

When initially loading my website, I need to load a couple of images from my Google cloud storage that have been uploaded by users. To speed up my load time, I would like to get the images in lower resolution.

是否可以使用URL来指定它,例如其他URL参数?...

Is there a way to specify this with the URL, like an additional URL parameter?...

我正在使用如下所示的签名URL:

I'm using signed URLs that look like this:

baseURL + "?GoogleAccessId=" + GoogleAccessStorageId + "&Expires=" + Expiration + "&Signature=" + UrlEncodedSignature

此处指定: https://cloud.google.com/storage/docs/access-control#Signed-URLs

推荐答案

不直接,不. AppEngine具有图像API ,该API可以提供来自GCS的图像,并且可以提供该图像可以包含转换,但是GCS本身与存储的对象类型无关,并且对图像文件或转换没有特殊的了解.

Not directly, no. AppEngine has an Images API that can serve images from GCS, and that image serving can include transformations, but GCS itself is agnostic to the type of objects it is storing and has no special knowledge of image files or transforming them.

一个选项是在您上传原始图像时,为每个图像存储一个较小的版本.然后,您可以直接直接引用该对象.第二种选择是通过AppEngine提供图像,以利用其图像API.

One option would be storing a smaller version of each image at the time that you upload the original. Then you may simply refer to that object directly. A second option would be to serve the images through AppEngine in order to take advantage of its Images API.

这篇关于从Google云存储获取调整大小的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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