code: def resize_to(img, targ_sz, use_min=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)
  
file_path: fastai/fastai/vision/utils.py
imports: from __future__ import annotations
  import uuid
  from ..torch_basics import *
  from ..data.all import *
  from .core import *
  from fastdownload import download_url
  from pathlib import Path
label_desc: Use image node_id 4 for calling a global function with example usage: resize_to(img, targ_sz, use_min) and returns: int,  int