pict-rs/src/exiftool.rs

14 lines
490 B
Rust
Raw Normal View History

2021-08-31 16:02:30 +00:00
pub(crate) fn clear_metadata_stream<S, E>(
input: S,
) -> std::io::Result<futures::stream::LocalBoxStream<'static, Result<actix_web::web::Bytes, E>>>
where
S: futures::stream::Stream<Item = Result<actix_web::web::Bytes, E>> + Unpin + 'static,
E: From<std::io::Error> + 'static,
{
let process = crate::stream::Process::spawn(
tokio::process::Command::new("exiftool").args(["-all=", "-", "-out", "-"]),
)?;
Ok(Box::pin(process.sink_stream(input).unwrap()))
}