收藏
回答

微信OCR识别接口图片大小超过2M时,压缩后识别报错的问题 错误码是 101001?

```

def resize_image(image):
    src_width, src_height = image.size
    if src_width > src_height:
        scale = 1080 / src_width
        img_height = round(src_height * scale)
        img_width = 1080
    else:
        scale = 1080 / src_height
        img_width = round(src_width * scale)
        img_height = 1080
    # cannot write mode RGBA as JPEG
    if image.mode != "RGB":
        image = image.convert("RGB")

    image.resize((img_width, img_height), Image.ANTIALIAS).save(
        new_img, "JPEG", quality=85, optimize=True
    )


```

使用python压缩的图片,我柑橘可能压缩后影响识别成功率,不知道有没有大佬遇到这种问题的

回答关注问题邀请回答
收藏

1 个回答

  • 😶
    😶
    2020-12-25

    你好,101001是图片中找不到证件。建议保存压缩后的图片检查一下

    2020-12-25
    有用
    回复
登录 后发表内容
问题标签