python更改图像尺寸resize
from PIL import Imageimport os.pathimport globdef convertjpg(jpgfile,outdir,width=256,height=256): img=Image.open(jpgfile) h, w = img.size if h != 256 or w != 256: try: print(jpgfile,h,w) new_img=img.resize((w