Get resized images from Google cloud storage

白昼怎懂夜的黑 提交于 2019-12-23 07:46:18

问题


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.

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

I'm using signed URLs that look like this:

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

as specified here: https://cloud.google.com/storage/docs/access-control#Signed-URLs


回答1:


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.

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.



来源:https://stackoverflow.com/questions/36006879/get-resized-images-from-google-cloud-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!