简体   繁体   中英

Google App Engine Images API - cropping using a bounding box with percentages

In the python google.appengine.api.images docs there are crop functions such as crop(left_x, top_y, right_x, bottom_y) , which allow you to specify a bounding box for cropping using percentages .

In addition, same docs say that one can append eg '=s32' to the image url returned by get_serving_url() in order to resize the image to 32px in the larger dimension. There are also crop options, however none of them are given with a bounding box (ie crop that's not defined from the corner nor around the center of the image) nor with percentages (all examples are around pixels).

Is there a way to replicate crop() 's behavior by appending options to the serving url returned by the get_serving_url() function?

According to Google's support, unfortunately it is not possible to crop a bounding box via serving_url as stated here .

Another point to consider is that their documentation of serving_url only support size and crop parameters only, but it works with a lot more options , so there is a possibility that it works as well, just be in mind that officially not.

And please, if you success on that, don't forget to share it here!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM