Matt Norris
Matt Norris

Reputation: 8836

Dynamically shrink an image with Google Images API, but do not enlarge

Google provides an excellent way to resize images dynamically; simply append =sXX to the image URL. This is perfect if you want to shrink an image, but if the image is smaller than the size specified, it enlarges it, giving it a pixelated effect.

Is there an easy way to say "don't enlarge, only shrink" when using serving URLs with a specified size?

UPDATE

This functionality is now a feature request at GAE. Vote it up if you'd like to see it!

Upvotes: 5

Views: 635

Answers (2)

RLH
RLH

Reputation: 15698

As stated in my comments above, this isn't possible.

Although I have no use of the image framework I can see how your request would be useful. May I suggest posting a Feature Request on the Google App Engines Issues BB?

After posting the request, update your StackOverflow question with a link to your Feature Request so that other users can +1 the request.

Here's the link to the GAE Issues Page. Although this is not a bug, you will need to click the New Issue button to request a feature.

Upvotes: 1

Gray
Gray

Reputation: 2333

What you could do is store the size of the image in the datastore so when you need the image to be a certain size, you can check in the datastore to see what size it is and add the =sXX accordingly.

Upvotes: 1

Related Questions