issueidentifier.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Comictagger 作者: dickloraine 项目源码 文件源码
def cropCover( self, image_data ):

        im = Image.open(StringIO.StringIO(image_data))
        w,h = im.size

        try:
            cropped_im = im.crop( (int(w/2), 0, w, h) )
        except Exception as e:
            sys.exc_clear()
            print "cropCover() error:", e
            return None

        output = StringIO.StringIO()
        cropped_im.save(output, format="PNG")
        cropped_image_data = output.getvalue()
        output.close()

        return cropped_image_data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号