In order to save precious bandwidth, the image serving app (a minor, but important part of the total app) tries to serve only thumbnails or reduced size previews of possibly large photos or illustrations. Storing the original image in the BlobStore is simple enough, and generating the thumbnails is also simple using the the Image service.
What I don't know how to do is put the thumbnails back into the BlobStore. I'd much rather do it this way so I don't have to implement two methods for serving images. Is there a way to send data from my app开发者_运维技巧 into the BlobStore? The only way I can concieve is to generate an upload URL and then post to that url using the URL Fetch Service, But if I have to go to that amount of trouble, I'd rather just put the thumbnails in the DataStore.
You don't need to create thumbnails from images in BlobStore at all - use get_serving_url
function instead (see http://code.google.com/appengine/docs/python/images/functions.html).
This function generates and caches thumbnails from large images in the fly and doesn't even cost you any CPU (see this post)
Here's a pretty good tutorial explaining how to use the Blobstore to store and serve images in a GWT/GAE app. The overview drawing is pretty helpful in understanding all the components.
http://www.fishbonecloud.com/2010/12/tutorial-gwt-application-for-storing.html
精彩评论