protected override string CollectArgument(IProperty property) { switch (property.Name) { case "seek": return(PreviewMode || !Seek.IsValid() ? null : string.Format((string)property.Value, Seek.TotalSeconds)); case "filter": int w, h; string select; string scale; string tile; if (PreviewMode) { w = -1; h = Height.NotBelow(-1); select = ",select=key"; tile = ",tile=100x1"; } else { w = Width.NotBelow(-1); h = Height.NotBelow(-1); float scene = SceneFilter.Within(-1.0f, 1.0f); select = scene <= 0.00f ? string.Empty : $",select=gt(scene\\,{scene:F2})"; tile = string.Empty; } if (w <= 0) { w = -1; } if (h <= 0) { h = -1; } scale = w > 0 || h > 0 ? $",scale={w}:{h}" : string.Empty; return(string.Format((string)property.Value, select + scale + tile)); case "frames": return(string.Format((string)property.Value, PreviewMode ? 1 : Frames.NotBelow(1))); case "variations": case "other": return((string)property.Value); case "output": if (PreviewMode || Frames < 2) { return(base.CollectArgument(property)); } if (string.IsNullOrWhiteSpace((string)property.Value)) { throw new ArgumentNullException(nameof(property.Value)); } if (string.IsNullOrWhiteSpace(Output)) { throw new InvalidOperationException(nameof(Output) + " is missing."); } string fileName = Path.GetFileNameWithoutExtension(Output); string ext = Path.GetExtension(Output); if (string.IsNullOrWhiteSpace(ext)) { ext = ".jpg"; } return(fileName + "%02d" + ext); default: return(base.CollectArgument(property)); } }