There was an error while loading. Please reload this page.
This resizes an image to within a bounding box. Make the first parameter very large to just scale to height.
def resize(filein, fileout, maxw, maxh): out = pyvips.Image.thumbnail(filein, maxw, height=maxh) out.write_to_file(fileout, Q=95)
It uses the thumbnail function of vips - which has a lot of features (and doesn't just make thumbnails).