Add image adjustments pipeline (brightness, contrast, crop, effects)

This commit is contained in:
2026-03-06 14:24:14 +02:00
parent 600b36279e
commit f3dc164018
6 changed files with 268 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ use rayon::prelude::*;
use crate::encoder::OutputEncoder;
use crate::error::{PixstripError, Result};
use crate::loader::ImageLoader;
use crate::operations::adjustments::apply_adjustments;
use crate::operations::resize::resize_image;
use crate::operations::watermark::apply_watermark;
use crate::operations::{Flip, Rotation};
@@ -340,6 +341,13 @@ impl PipelineExecutor {
img = resize_image(&img, config)?;
}
// Adjustments (brightness, contrast, saturation, effects, crop, padding)
if let Some(ref adj) = job.adjustments {
if !adj.is_noop() {
img = apply_adjustments(img, adj)?;
}
}
// Watermark (after resize so watermark is at correct scale)
if let Some(ref config) = job.watermark {
img = apply_watermark(img, config)?;