MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / NewFileImage

Function NewFileImage

message/elements.go:261–267  ·  view source on GitHub ↗
(path string, summary ...string)

Source from the content-addressed store, hash-verified

259}
260
261func NewFileImage(path string, summary ...string) (*ImageElement, error) {
262 img, err := os.Open(path)
263 if err != nil {
264 return nil, err
265 }
266 return NewStreamImage(img, summary...), nil
267}
268
269func NewVideo(data, thumb []byte, summary ...string) *ShortVideoElement {
270 return NewStreamVideo(bytes.NewReader(data), bytes.NewReader(thumb), summary...)

Callers 1

mainFunction · 0.92

Calls 1

NewStreamImageFunction · 0.85

Tested by

no test coverage detected