We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write_image_jpeg
Add support for writing images with async that can be useful for i/o bound tasks in robotics and avoid people creating their threadpool.
requested by @haixuanTao for dora-rs
Current impl:
pub fn write_image_jpeg(file_path: &str, image: PyImage) -> PyResult<()> { let image = Image::from_pyimage(image) .map_err(|e| PyErr::new::<pyo3::exceptions::PyException, _>(format!("{}", e)))?; F::write_image_jpeg(file_path, &image) .map_err(|e| PyErr::new::<pyo3::exceptions::PyException, _>(format!("{}", e)))?; Ok(()) }
proposal with async
pub fn write_image_jpeg(file_path: &str, image: PyImage) -> PyResult<()> { let image = Image::from_pyimage(image) .map_err(|e| PyErr::new::<pyo3::exceptions::PyException, _>(format!("{}", e)))?; use std::thread; thread::spawn(move || { F::write_image_jpeg(file_path, &image) .map_err(|e| PyErr::new::<pyo3::exceptions::PyException, _>(format!("{}", e)))?; }); Ok(()) }
Discussed to return a join Handle so that people can query state pending, failure or success
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Add support for writing images with async that can be useful for i/o bound tasks in robotics and avoid people creating their threadpool.
requested by @haixuanTao for dora-rs
Current impl:
proposal with async
Discussed to return a join Handle so that people can query state pending, failure or success
The text was updated successfully, but these errors were encountered: