在Google App Engine(GAE)中替换PIL(ImageDraw)的功能 [英] Replacing Functionality of PIL (ImageDraw) in Google App Engine (GAE)

查看:149
本文介绍了在Google App Engine(GAE)中替换PIL(ImageDraw)的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,Google App Engine似乎不会包含Python影像库即将发布。有一个图片API ,但它微不足道,不足以满足我的需求。

我想知道什么是Python(没有C扩展),可以替换Image.paste和ImageDraw模块。我不想自己写,但这是一个选项。我也开放给其他解决方案,比如在其他地方处理,然后通过API调用,如果它们不是很丑的话。 (为了记录,我刚才建议的解决方案对我来说似乎很丑陋。)



其他人如何解决这个问题?



(我并不喜欢GAE,只是在探索,这对我的应用来说看起来像是一笔交易。)

注意:

对于我来说,裁剪,调整大小是不够的。特别是我需要


  1. 粘贴(将图像的一部分替换为另一个....可以用合成来伪造)
  2. >
  3. 绘制(用于绘制网格线等)也可以伪造)
  4. text(在图像上写文字,除非有人想要伪造正确的我)
  5. 你的假设是错误的。如果您使用Python 2.7运行时,则可以使用PIL(版本1.1.7),如以下文档所述: https://developers.google.com/appengine/docs/python/tools/libraries27
    本文还解释了如何为您的应用启用PIL。


    顺便说一句,您引用的错误的最后一条评论也提到了它。


    So, Google App Engine doesn't look like it's going to include the Python Imaging Library anytime soon. There is an images api, but it's paltry, and inadequate for what I need.

    I'm wondering what Python only (no C-extensions) there are that can replace the Image.paste and the ImageDraw modules. I don't want to write them myself, but that is an option. I'm also open to other solutions, such as "do the processing somewhere else, then call via api", if they're not too ugly. (For the record, the solution I just suggested seems pretty ugly to me.)

    How have others gotten around this?

    (I'm not wedded to GAE, just exploring, and this looks like a deal breaker for my app.)

    Notes:

    For me, crop, resize is not enough. In particular I need

    1. paste (replace part of an image with another.... can be faked with "compose")
    2. draw (for drawing gridlines, etc. Can be faked as well)
    3. text (write text on an image, much harder to fake, unless someone wants to correct me)

    解决方案

    Your assumption is wrong. If you use the Python 2.7 runtime, you can use PIL (version 1.1.7) as documented here: https://developers.google.com/appengine/docs/python/tools/libraries27. This article also explains how to enable PIL for your app.

    BTW, the last comment in the bug you referenced also mentions it.

    这篇关于在Google App Engine(GAE)中替换PIL(ImageDraw)的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆