diff --git a/vlib/stbi/stbi.c.v b/vlib/stbi/stbi.c.v index 37f4aec7ca..8882ddc493 100644 --- a/vlib/stbi/stbi.c.v +++ b/vlib/stbi/stbi.c.v @@ -135,14 +135,13 @@ pub fn load(path string, params LoadParams) !Image { } // load_from_memory load an image from a memory buffer -pub fn load_from_memory(buf &u8, bufsize int) !Image { +pub fn load_from_memory(buf &u8, bufsize int, params LoadParams) !Image { mut res := Image{ ok: true data: 0 } - flag := C.STBI_rgb_alpha res.data = C.stbi_load_from_memory(buf, bufsize, &res.width, &res.height, &res.nr_channels, - flag) + params.desired_channels) if isnil(res.data) { return error('stbi_image failed to load from memory') }