Cykooz / fast_image_resize

Rust library for fast image resizing with using of SIMD instructions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImageView::from_buffer returns an error if the provided buffer larger than the minimum required size

Farmadupe opened this issue · comments

I am using this library to resize video frames from Gstreamer. Gstreamer sometimes creates frame buffers which are oversized.

When calling ImageView::from_buffer before resizing such frames, fast_image_resize returns error ImageBufferError::InvalidBufferSize. I expected that an oversize buffer would not cause an error.

For comparison, the image crate's "equivalent" type ImageBuffer::<Luma, &[u8]> does accept buffers which are oversized.

(It is easy to slice the buffer down to the right size before passing it into this crate, but it would be nice if this was not necessary)

(P.S. This crate is very fast :) -- it is nice to be able to resize frames in rust with competetive speed to resizing inside the Gstreamer pipeline)

Fixed in v0.8