diff --git a/Cargo.toml b/Cargo.toml index 0d9ff1f29a..5858e9d6ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,6 @@ num-traits = "0.2.0" gif = { version = "0.12", optional = true } jpeg = { package = "jpeg-decoder", version = "0.3.0", default-features = false, optional = true } png = { version = "0.17.6", optional = true } -scoped_threadpool = { version = "0.1", optional = true } tiff = { version = "0.8.0", optional = true } ravif = { version = "0.11.0", optional = true } rgb = { version = "0.8.25", optional = true } @@ -67,7 +66,7 @@ ico = ["bmp", "png"] pnm = [] tga = [] bmp = [] -hdr = ["scoped_threadpool"] +hdr = [] dxt = [] dds = ["dxt"] farbfeld = [] diff --git a/Cargo.toml.public-private-dependencies b/Cargo.toml.public-private-dependencies index bdce0c13d1..540949de6f 100644 --- a/Cargo.toml.public-private-dependencies +++ b/Cargo.toml.public-private-dependencies @@ -37,7 +37,6 @@ num-traits = { version = "0.2.0", public = true } gif = { version = "0.11.1", optional = true } jpeg = { package = "jpeg-decoder", version = "0.2.1", default-features = false, optional = true } png = { version = "0.17.0", optional = true } -scoped_threadpool = { version = "0.1", optional = true } tiff = { version = "0.7.1", optional = true } ravif = { version = "0.8.0", optional = true } rgb = { version = "0.8.25", optional = true } @@ -63,7 +62,7 @@ pnm = [] tga = [] webp = [] bmp = [] -hdr = ["scoped_threadpool"] +hdr = [] dxt = [] dds = ["dxt"] farbfeld = [] diff --git a/src/codecs/hdr/decoder.rs b/src/codecs/hdr/decoder.rs index ac37edce7a..6915f0d15f 100644 --- a/src/codecs/hdr/decoder.rs +++ b/src/codecs/hdr/decoder.rs @@ -1,6 +1,5 @@ use crate::Primitive; use num_traits::identities::Zero; -use scoped_threadpool::Pool; #[cfg(test)] use std::borrow::Cow; use std::convert::TryFrom; @@ -460,21 +459,16 @@ impl HdrDecoder { } let chunks_iter = output_slice.chunks_mut(self.width as usize); - let mut pool = Pool::new(8); // - - (pool.scoped(|scope| { - for chunk in chunks_iter { - let mut buf = vec![Default::default(); self.width as usize]; - read_scanline(&mut self.r, &mut buf[..])?; - let f = &f; - scope.execute(move || { - for (dst, &pix) in chunk.iter_mut().zip(buf.iter()) { - *dst = f(pix); - } - }); + + let mut buf = vec![Default::default(); self.width as usize]; + for chunk in chunks_iter { + // read_scanline overwrites the entire buffer or returns an Err, + // so not resetting the buffer here is ok. + read_scanline(&mut self.r, &mut buf[..])?; + for (dst, &pix) in chunk.iter_mut().zip(buf.iter()) { + *dst = f(pix); } - Ok(()) - }) as Result<(), ImageError>)?; + } Ok(()) }