Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9203575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:30:12+00:00 2026-06-17T23:30:12+00:00

ImagesService imagesService = ImagesServiceFactory.getImagesService(); BlobKey bk = currentProfile.getProfileBlobKey(); Image oldImage = ImagesServiceFactory.makeImageFromBlob(bk); Transform resize

  • 0
ImagesService imagesService = ImagesServiceFactory.getImagesService();
BlobKey bk = currentProfile.getProfileBlobKey();
Image oldImage = ImagesServiceFactory.makeImageFromBlob(bk);
Transform resize = ImagesServiceFactory.makeResize(500, 500);
Image newImage = imagesService.applyTransform(resize, oldImage);
int imageWidth = newImage.getWidth();
int imageHeight = newImage.getHeight();

This code doesn’t seem to work since ImagesServiceFactory.makeImageFromBlob(bk); doesn’t return a real Image. Does anyone know a workaround for this? This seems to be the expected behavior. This issue is discussed here but they don’t have a solution for getting the height and width just the byte[]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:30:13+00:00Added an answer on June 17, 2026 at 11:30 pm

    Try this:

    FileService fileService = FileServiceFactory.getFileService();
    AppEngineFile blobFile = fileService.getBlobFile(blobKey);
    FileReadChannel readChannel = fileService.openReadChannel(blobFile, false);
    byte[] imageData = getBytes(Channels.newInputStream(readChannel));
    Image oldImage = ImagesServiceFactory.makeImage(imageData);
    // now you have the real Image
    

    and this little snippet for reading an input stream:

    public static byte[] getBytes(InputStream is) throws IOException {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    
        int len;
        byte[] data = new byte[10000];
        while ((len = is.read(data, 0, data.length)) != -1) {
            buffer.write(data, 0, len);
        }
    
        buffer.flush();
        return buffer.toByteArray();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an issue with calling applyTransform() from ImagesService when running locally. When
In Google AppEngine I want to transform a boolean[] into an image then serve
I'm trying to resize and crop images into Google App engine in order to
I'm writing an app where a user can upload an image, draw on it
I’ve got a method which takes an input image, does some things to the
I am using imagery service to get an image from bing maps, and from
I want to reduce image size (in KB) when its size is larger than
I'm using App Engine's high performance image serving on my site, and I'm able
I have a form (using MVC2) which has an image-upload script, but the rules
I have an image in blob store which is uploaded by users(their profile pic).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.