17
votes

I want to serve image files on Google Cloud Storage with Images API get_serving_url. Can get_serving_url accept files on Google Cloud Storage?

I tried:

from google.appengine.api import blobstore
from google.appengine.api import images
bkey = blobstore.create_gs_key('/gs/bucket/object')
url = images.get_serving_url(bkey)

A error InvalidBlobKeyError occured on get_serving_url in production environment.

2
this is a great question: I need to get out of blobstore, but continue to use the feature of putting =sXXX to resize images on the fly!Michele Orsi
Since 1.7.0, We are going to be able to use get_serving_url() for Google Cloud Storage buckets.najeira
blobstore is no longer needed, one can just use images.get_serving_url(None, filename='/gs/<bucket>/<object>'))Spain Train

2 Answers

13
votes

Everybody would love that, and since 1.7.0 version it is possible!

You can use the get_serving_url() for Google Cloud Storage buckets.

5
votes

Just as of GAE 1.6.5, the images.Image class constructor can take as an argument a GCS file name, e.g.

 img = images.Image(filename='/gs/bucket/object')

You can then execute transforms on that object and serve it up, etc.