Resize image in Google Cloud Storage

1 view
Skip to first unread message

Ralf via StackOverflow

unread,
Apr 29, 2014, 8:45:51 PM4/29/14
to google-appengin...@googlegroups.com

The appengine/image package works fine with images stored in Blobstore. However, what would be a good approach to resize images stored in Google Cloud Storage?



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/23377736/resize-image-in-google-cloud-storage

Andrei Volgin via StackOverflow

unread,
Apr 29, 2014, 8:50:51 PM4/29/14
to google-appengin...@googlegroups.com

You can use the same Image Service with the Google Cloud Storage, especially if you use Blobstore API for uploading images.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/23377736/resize-image-in-google-cloud-storage/23377792#23377792

Andrei Volgin via StackOverflow

unread,
Apr 29, 2014, 9:40:57 PM4/29/14
to google-appengin...@googlegroups.com

You can use the same Image Service with the Google Cloud Storage, especially if you use Blobstore API for uploading images.

A sample code in Java:

String fullName = "/gs/" + bucketName + "/" + objectName;
Image picture = ImagesServiceFactory.makeImageFromFilename(fullName);
Transform resize = ImagesServiceFactory.makeResize(maxWidth, maxHeight);
picture = imagesService.applyTransform(resize, picture);

In Go, you can use BlobKeyForFile function:

BlobKeyForFile returns a BlobKey for a Google Storage file. The filename should be of the form "/gs/bucket_name/object_name".

Reply all
Reply to author
Forward
0 new messages