MCPcopy Index your code
hub / github.com/TruthHun/BookStack / ImageCopyFromFile

Function ImageCopyFromFile

graphics/copy.go:29–38  ·  view source on GitHub ↗
(p string, x, y, w, h int)

Source from the content-addressed store, hash-verified

27}
28
29func ImageCopyFromFile(p string, x, y, w, h int) (src image.Image, err error) {
30 file, err := os.Open(p)
31 if err != nil {
32 return src, err
33 }
34 defer file.Close()
35 src, _, err = image.Decode(file)
36
37 return ImageCopy(src, x, y, w, h)
38}
39
40func ImageResize(src image.Image, w, h int) image.Image {
41 return resize.Resize(uint(w), uint(h), src, resize.Lanczos3)

Callers 2

UploadMethod · 0.92
UploadCoverMethod · 0.92

Calls 1

ImageCopyFunction · 0.85

Tested by

no test coverage detected