Add image adjustments pipeline (brightness, contrast, crop, effects)
This commit is contained in:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user