Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get resized images from Google cloud storage

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

like image 911
kolli Avatar asked Mar 15 '16 09:03

kolli


1 Answers

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.

like image 199
Brandon Yarbrough Avatar answered Nov 16 '22 02:11

Brandon Yarbrough