diff --git a/src/magick.rs b/src/magick.rs index 40fc55c..eb04ee9 100644 --- a/src/magick.rs +++ b/src/magick.rs @@ -18,6 +18,7 @@ pub(crate) enum ValidInputType { Webp, } +#[derive(Debug)] pub(crate) struct Details { pub(crate) mime_type: mime::Mime, pub(crate) width: usize, @@ -30,6 +31,7 @@ pub(crate) fn clear_metadata_bytes_read(input: Bytes) -> std::io::Result Result { let process = Process::run( "magick", @@ -133,6 +135,7 @@ fn parse_details(s: std::borrow::Cow<'_, str>) -> Result { }) } +#[instrument(name = "Getting input type from bytes", skip(input))] pub(crate) async fn input_type_bytes(input: Bytes) -> Result { details_bytes(input).await?.validate_input() } @@ -158,6 +161,7 @@ pub(crate) fn process_image_file_read( } impl Details { + #[instrument(name = "Validating input type")] fn validate_input(&self) -> Result { if self.width > crate::CONFIG.max_width() || self.height > crate::CONFIG.max_height() { return Err(UploadError::Dimensions.into());