MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / SmartCrop

Method SmartCrop

vips/vips.go:669–678  ·  view source on GitHub ↗
(width, height int)

Source from the content-addressed store, hash-verified

667}
668
669func (img *Image) SmartCrop(width, height int) error {
670 var tmp *C.VipsImage
671
672 if C.vips_smartcrop_go(img.VipsImage, &tmp, C.int(width), C.int(height)) != 0 {
673 return Error()
674 }
675
676 img.swapAndUnref(tmp)
677 return nil
678}
679
680func (img *Image) Trim(threshold float64, smart bool, color color.RGB, equalHor bool, equalVer bool) error {
681 var tmp *C.VipsImage

Callers 1

cropImageFunction · 0.80

Calls 2

swapAndUnrefMethod · 0.95
ErrorFunction · 0.70

Tested by

no test coverage detected