using System.ComponentModel;
namespace FileFlows.ImageNodes.Images;
///
/// Flow element that crops an image of any white/black borders
///
public class AutoCropImage : ImageNode
{
///
public override int Inputs => 1;
///
public override int Outputs => 2;
///
public override FlowElementType Type => FlowElementType.Process;
///
public override string HelpUrl => "https://fileflows.com/docs/plugins/image-nodes/auto-crop-image";
///
public override string Icon => "fas fa-crop";
///
/// Gets or sets the crop threshold
///
[Slider(1)]
[Range(1, 100)]
[DefaultValue(50)]
public int Threshold { get; set; }
///
protected override Result PerformAction(NodeParameters args, string localFile, string destination)
=> args.ImageHelper.Trim(localFile, destination, Threshold, GetImageTypeFromFormat(), Quality);
}