Mangesh Mandavgane
Mangesh Mandavgane

Reputation: 360

Transforming images from the Blobstore

I am trying to get image from Blobstore by using blobKey But I am getting Exception "com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'images' or call 'Transform()' was not found."

I have refer this link to Transform image

Included packages

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.images.Image;
import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.images.Transform;

My code is

BlobKey blobKey = new BlobKey("nt6Qo5yvgQu9byMAQEprqA") ;           
ImagesService imagServ = ImagesServiceFactory.getImagesService();           
Image oldImag = ImagesServiceFactory.makeImageFromBlob(blobKey);            
Transform tran = ImagesServiceFactory.makeResize(200, 300);                     
Image newImag = imagServ.applyTransform(tran,oldImag);
byte[] newImagData = newImag.getImageData();

I am getting Exception on 5th line of my code i.e hereImage newImag = imagServ.applyTransform(tran,oldImag);

Upvotes: 3

Views: 246

Answers (1)

Ying Li
Ying Li

Reputation: 2519

How are you deploying the code? Please make sure the library is in the build path and it's deployed properly then try again. I tried the exact tutorial and it worked, I am using Eclipse though.

Upvotes: 1

Related Questions