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

Method Resize

vips/vips.go:578–592  ·  view source on GitHub ↗
(wscale, hscale float64)

Source from the content-addressed store, hash-verified

576}
577
578func (img *Image) Resize(wscale, hscale float64) error {
579 var tmp *C.VipsImage
580
581 if C.vips_resize_go(img.VipsImage, &tmp, C.double(wscale), C.double(hscale)) != 0 {
582 return Error()
583 }
584
585 if wscale < 1.0 || hscale < 1.0 {
586 C.vips_image_set_int(tmp, cachedCString("imgproxy-scaled-down"), 1)
587 }
588
589 img.swapAndUnref(tmp)
590
591 return nil
592}
593
594func (img *Image) Orientation() C.int {
595 return C.vips_get_orientation(img.VipsImage)

Callers 5

scaleMethod · 0.80
fixWebpSizeFunction · 0.80
fixHeifSizeFunction · 0.80
fixGifSizeFunction · 0.80
fixIcoSizeFunction · 0.80

Calls 3

swapAndUnrefMethod · 0.95
cachedCStringFunction · 0.85
ErrorFunction · 0.70

Tested by

no test coverage detected