code: func resizeAndCrop(img image.Image, width, height int, anchor Anchor, filter ResampleFilter) *image.NRGBA {
  	dstW, dstH := width, height
  
  	srcBounds := img.Bounds()
  	srcW := srcBounds.Dx()
  	srcH := srcBounds.Dy()
  	srcAspectRatio := float64(srcW) / float64(srcH)
  	dstAspectRatio := float64(dstW) / float64(dstH)
  
  	var tmp *image.NRGBA
  	if srcAspectRatio < dstAspectRatio {
  		tmp = Resize(img, dstW, 0, filter)
  	} else {
  		tmp = Resize(img, 0, dstH, filter)
  	}
  
  	return CropAnchor(tmp, dstW, dstH, anchor)
  }
docs: // resizeAndCrop resizes the image to the smallest possible size that will cover the specified dimensions,
  // crops the resized image to the specified dimensions using the given anchor point and returns
  // the transformed image.