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)
| 31 | // |
| 32 | //export imgproxyReaderSeek |
| 33 | func 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 | // |