def scale_image(fileish, width: int) -> Image:
""" scales image with given width. fileish may be file or path """
img = utils.ImageReader(fileish)
orig_width, height = img.getSize()
aspect = height / orig_width
return Image(fileish, width=width, height=width * aspect)
评论列表
文章目录