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

Function imgproxyReaderSeek

vips/source.go:33–48  ·  view source on GitHub ↗

calls seek() on the async reader via it's handle from the C side export imgproxyReaderSeek

(handle C.uintptr_t, offset C.int64_t, whence int)

Source from the content-addressed store, hash-verified

31//
32//export imgproxyReaderSeek
33func imgproxyReaderSeek(handle C.uintptr_t, offset C.int64_t, whence int) C.int64_t {
34 h := cgo.Handle(handle)
35 r, ok := h.Value().(io.ReadSeeker)
36 if !ok {
37 vipsError("imgproxyReaderSeek", "failed to cast handle to io.ReadSeeker")
38 return -1
39 }
40
41 pos, err := r.Seek(int64(offset), whence)
42 if err != nil {
43 vipsError("imgproxyReaderSeek", "failed to seek: %v", err)
44 return -1
45 }
46
47 return C.int64_t(pos)
48}
49
50// calls read() on the async reader via it's handle from the C side
51//

Callers

nothing calls this directly

Calls 3

vipsErrorFunction · 0.85
SeekMethod · 0.80
HandleMethod · 0.45

Tested by

no test coverage detected