code: def resize_to(img, targ_sz:int, use_min:bool=False):
      "Size to resize to, to hit `targ_sz` at same aspect ratio, in PIL coords (i.e w*h)"
      w,h = img.size
      min_sz = (min if use_min else max)(w,h)
      ratio = targ_sz/min_sz
      return int(w*ratio),int(h*ratiof resize_to(img, targ_sz:int, use_min:bool=False):
      "Size to resize to, to hit `targ_sz` at same aspect ratio, in PIL coords (i.e w*h)"
      w,h = img.size
      min_sz = (min if use_min else max)(w,h)
      ratio = targ_sz/min_sz
      return int(w*ratio),int(h*ratio)
docs: Size to resize to, to hit `targ_sz` at same aspect ratio, in PIL coords (i.e w*h)