code: def _transform_image(
      inpath,
      outpath,
      size=None,
      min_size=None,
      max_size=None,
      interpolation=None,
      force_reencode=False,
      delete_original=False,
      skip_failures=False,
  ):
      inpath = fos.normalize_path(inpath)
      outpath = fos.normalize_path(outpath)
      in_ext = os.path.splitext(inpath)[1]
      out_ext = os.path.splitext(outpath)[1]
  
      did_transform = False
      moves = []
  
      try:
          should_reencode = (
              force_reencode
              or size is not None
              or min_size is not None
              or max_size is not None
              or in_ext.lower() != out_ext.lower()
          )
  
          if should_reencode:
              img = read(inpath)
              size = _parse_parameters(img, size, min_size, max_size)
  
          if (
              should_reencode
              and inpath == outpath
              and not delete_original
          ):
              orig_path = etau.make_unique_path(
                  inpath, suffix="-original"
              )
              etau.move_file(inpath, orig_path)
              moves.append((inpath, orig_path))
              inpath = orig_path
  
          if size is not None:
              if interpolation is not None:
                  kwargs = dict(interpolation=interpolation)
              else:
                  kwargs = {}
  
              img = etai.resize(
                  img, width=size[0], height=size[1], **kwargs
              )
              write(img, outpath)
              did_transform = True
          elif should_reencode:
              write(img, outpath)
              did_transform = True
          elif inpath != outpath:
              etau.copy_file(inpath, outpath)
  
          if delete_original and inpath != outpath:
              etau.delete_file(inpath)
      except BaseException as e:
          try:
              # Undo any moves
              for from_path, to_path in moves:
                  etau.move_file(to_path, from_path)
          except:
              pass
  
          if not skip_failures:
              raise
  
          logger.warning(e)
  
      return did_transform
  
imports: import logging
  import os
  import eta.core.image
  import eta.core.utils
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 11 for calling a global function with example usage: _transform_image(inpath, outpath, size, min_size, max_size, interpolation, force_reencode, delete_original, skip_failures) and returns: did_transform