Skip to content

Commit 3f3b59a

Browse files
committed
feat: add at_crate!() boundary markers at zencodecs call sites
Mark crate boundaries in job.rs where zencodecs results cross into zenpipe: probe, format selection, decode, gain map decode, encode. This adds zenpipe's crate info to the error trace chain.
1 parent 890880b commit 3f3b59a

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/job.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ use crate::Source;
3838
use crate::bridge::NodeConverter;
3939
#[allow(unused_imports)]
4040
use whereat::at;
41+
#[allow(unused_imports)]
42+
use whereat::at_crate;
4143

4244
use crate::error::PipeError;
4345
use crate::format::PixelFormat;
@@ -431,7 +433,7 @@ impl<'a> ImageJob<'a> {
431433
};
432434

433435
// 2. Probe the source.
434-
let image_info = zencodecs::from_bytes_with_registry(input_bytes, &self.registry)
436+
let image_info = at_crate!(zencodecs::from_bytes_with_registry(input_bytes, &self.registry))
435437
.map_err(|e| at!(PipeError::Op(alloc::format!("probe failed: {e}"))))?;
436438

437439
let decode_info = DecodeInfo {
@@ -448,12 +450,12 @@ impl<'a> ImageJob<'a> {
448450
let facts = zencodecs::ImageFacts::from_image_info(&image_info);
449451

450452
// 4. Select output format.
451-
let decision = zencodecs::select_format_from_intent(
453+
let decision = at_crate!(zencodecs::select_format_from_intent(
452454
&self.intent,
453455
&facts,
454456
&self.registry,
455457
&zencodecs::CodecPolicy::default(),
456-
)
458+
))
457459
.map_err(|e| at!(PipeError::Op(alloc::format!("format selection failed: {e}"))))?;
458460

459461
// 5. Decode the source to a pixel stream, optionally extracting gain map.
@@ -549,9 +551,9 @@ impl<'a> ImageJob<'a> {
549551
}
550552
Err(_) => {
551553
// Fall back to full-frame decode.
552-
let decoded = zencodecs::DecodeRequest::new(data)
554+
let decoded = at_crate!(zencodecs::DecodeRequest::new(data)
553555
.with_registry(&self.registry)
554-
.decode_full_frame()
556+
.decode_full_frame())
555557
.map_err(|e| at!(PipeError::Op(alloc::format!("decode failed: {e}"))))?;
556558

557559
let pixels = decoded.pixels();
@@ -583,8 +585,8 @@ impl<'a> ImageJob<'a> {
583585
request = request.with_codec_config(config);
584586
}
585587

586-
let (decoded, gain_map) = request
587-
.decode_gain_map()
588+
let (decoded, gain_map) = at_crate!(request
589+
.decode_gain_map())
588590
.map_err(|e| at!(PipeError::Op(alloc::format!("decode with gain map failed: {e}"))))?;
589591

590592
// Convert base image to Source.
@@ -868,8 +870,8 @@ impl<'a> ImageJob<'a> {
868870
}
869871
}
870872

871-
let encode_output = oneshot_request
872-
.encode(pixels, format.has_alpha())
873+
let encode_output = at_crate!(oneshot_request
874+
.encode(pixels, format.has_alpha()))
873875
.map_err(|e| at!(PipeError::Op(alloc::format!("encode failed: {e}"))))?;
874876

875877
Ok(EncodeResult {

0 commit comments

Comments
 (0)