jan
jan

Reputation: 4103

App Engine - How to save a Blob?

So I have an image saved as Blob. I look it up and crop it with the help of the ImagesService. But how can I save my newly generated com.google.appengine.api.images.Image as a Blob again? I found some examples using com.google.appengine.api.files.FileService, but the interface is deprecated.

ImagesService imagesService = ImagesServiceFactory.getImagesService();

Image oldImage = ImagesServiceFactory.makeImageFromBlob(new BlobKey(myBlobKey));

Transform crop = ImagesServiceFactory.makeCrop(0, 0, 0.5, 0.5);

Image newImage = imagesService.applyTransform(crop, oldImage);

What is the best (not deprecated) way to store it now?

Upvotes: 1

Views: 199

Answers (1)

Jaime Gomez
Jaime Gomez

Reputation: 7067

The current recommended method is to use the Google Cloud Storage Client Library, which is an interface to Google Cloud Storage. There's a 5GB free quota when using the default bucket.

It works similar to the Files API, by creating and writing files, but the system is more robust so there's some added complexity (albeit small once past the initial configuration).

I recommend you to take the steps outlined in the What to do next section, and reading the Getting Started guide, which will tell you everything you need to now on how to implement it.

Upvotes: 2

Related Questions