padding filter debug: only keep images where padding% > 0
This commit is contained in:
parent
6197a1ce75
commit
5aea6ab176
1 changed files with 5 additions and 0 deletions
|
|
@ -98,6 +98,11 @@ impl ProcessingStep for CropAndResizeStep {
|
||||||
let edges = ctx
|
let edges = ctx
|
||||||
.get_computed(computed_keys::PADDING_EDGES)
|
.get_computed(computed_keys::PADDING_EDGES)
|
||||||
.and_then(|v| v.as_padding_edges())?;
|
.and_then(|v| v.as_padding_edges())?;
|
||||||
|
|
||||||
|
// Don't save debug images for passed photos with zero padding
|
||||||
|
if edges.total_fraction() == 0.0 {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
let image = ctx.image.as_ref()?;
|
let image = ctx.image.as_ref()?;
|
||||||
let rgb = image.to_rgb8();
|
let rgb = image.to_rgb8();
|
||||||
let (width, height) = (rgb.width(), rgb.height());
|
let (width, height) = (rgb.width(), rgb.height());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue