Processing image from the blob GAE

五迷三道 提交于 2019-12-02 07:38:26

You don't need to pipe that image through your application. The gae has a service for resizing images:

from google.appengine.api.images import get_serving_url
url = get_serving_url( "blobkey")

Then append one of https://developers.google.com/appengine/docs/python/images/functions#imgsize values to that url and you're done.

The first answer was close. This slight refinement lets you adjust the size explicitly:

from google.appengine.api.images import get_serving_url
url = get_serving_url( "blobkey",size=1024)

In the above code, size=1024 dynamically resizes the source blob image to be 1024 pixels on the longest side while maintaining the original proportion of the image.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!