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

Method Crop

vips/vips.go:651–660  ·  view source on GitHub ↗
(left, top, width, height int)

Source from the content-addressed store, hash-verified

649}
650
651func (img *Image) Crop(left, top, width, height int) error {
652 var tmp *C.VipsImage
653
654 if C.vips_extract_area_go(img.VipsImage, &tmp, C.int(left), C.int(top), C.int(width), C.int(height)) != 0 {
655 return Error()
656 }
657
658 img.swapAndUnref(tmp)
659 return nil
660}
661
662func (img *Image) Extract(out *Image, left, top, width, height int) error {
663 if C.vips_extract_area_go(img.VipsImage, &out.VipsImage, C.int(left), C.int(top), C.int(width), C.int(height)) != 0 {

Callers 2

applyWatermarkMethod · 0.80
cropImageFunction · 0.80

Calls 2

swapAndUnrefMethod · 0.95
ErrorFunction · 0.70

Tested by

no test coverage detected