mets_to_iiif.py 文件源码

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

项目:mets2man 作者: thegetty 项目源码 文件源码
def create_thumb(img_name):
    image = Image.open('{}.tiff'.format(img_name))
    (imageW, imageH) = image.size
    if imageW > imageH:
        ratio = thumb_size / imageW
        newWidth = 400
        newHeight = int(imageH * ratio)
    else:
        ratio = thumb_size / imageH
        newHeight = 400
        newWidth = int(imageW * ratio)  

    image = image.resize((newWidth, newHeight), Image.LANCZOS)
    outfh = open('{}_thumb.tiff'.format(img_name), 'wb')
    image.save(outfh, format='TIFF')
    outfh.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号