Google App Engine. Resize only big images with get_serving_url()
I have created website where users can upload image w开发者_开发知识库ith any size.
I have served images with get_serving_url
function.
I have added to end of image modifiers to resize image to 200px size.
http://127.0.0.1:8080/_ah/img/dtrh0i6I_V5JGulg2_LKZw===s200
I have uploaded image 1000x800 - and all right - I have image with size 200x160
If I have uploaded image 100x50 - in result I have resized image with size 200x100. But this is not a good. I need to show original small image, if image size lower that 200px.
How to do this on Google App Engine + Python with get_serving_url
?
What you need can't be done automatically using get_serving_url
.
I think the easiest way to implement that would be saving the image along with a needs_resize
property and calling get_serving_url
without size
parameter if that is not the case (which serves the original image).
精彩评论