Skip to content

Commit 6179426

Browse files
committed
changes for 3.34.0
Add feature to auto crop black bars, find the option in *Crop filter*
1 parent 146415c commit 6179426

File tree

9 files changed

+63
-6
lines changed

9 files changed

+63
-6
lines changed

Binaries/Win32/AutoCrop.dll

92 KB
Binary file not shown.

Filters/Crop.Designer.cs

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Filters/Crop.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ private enum Corner
3939

4040
public DynamicCropFilter GeneratedCropPanFilter { get; set; }
4141

42-
public CropForm(CropFilter CropPixels)
42+
public CropForm(CropFilter CropPixels, CropBarsFilter cropBarsFilter)
4343
{
4444
InitializeComponent();
4545
SetEvents();
4646
InputFilter = CropPixels;
47+
cropBars.Checked = cropBarsFilter != null ? true : false;
4748
}
4849

4950
public CropForm()
@@ -711,6 +712,20 @@ private void dynamicCropActive_CheckedChanged(object sender, EventArgs e)
711712
ShowNewDimension();
712713
}
713714

715+
716+
private void cropBars_CheckedChanged(object sender, EventArgs e)
717+
{
718+
if (cropBars.Checked)
719+
{
720+
Filters.CropBarsFilter = new CropBarsFilter();
721+
}
722+
else
723+
{
724+
Filters.CropBarsFilter = null;
725+
}
726+
727+
}
728+
714729
}
715730

716731
public class CropFilter
@@ -809,4 +824,9 @@ public DynamicCropFilter(IDictionary<int, CropPoint> cropsList, int maximum)
809824

810825
public override string ToString() => cropFilter;
811826
}
827+
828+
public class CropBarsFilter
829+
{
830+
public override string ToString() => $"AutoCrop(mode=3, wMultOf=2, hMultOf=2, leftAdd=0, topAdd=0, rightAdd=0, bottomAdd=0, threshold=40, samples=5, samplestartframe=0, sampleendframe=-1, aspect=0)";
831+
}
812832
}

MainForm.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ void removeFilter(ListViewItem filterListViewItem)
13161316
case "Crop":
13171317
Filters.Crop = null;
13181318
Filters.DynamicCrop = null;
1319+
Filters.CropBarsFilter = null;
13191320
buttonCrop.Enabled = true;
13201321
boxStabilization.Checked = false;
13211322
SetSlices();
@@ -2180,6 +2181,12 @@ void WriteAvisynthScript(string avsFileName, string avsInputFile)
21802181
avscript.WriteLine(Filters.Denoise);
21812182
}
21822183

2184+
if (Filters.CropBarsFilter != null)
2185+
{
2186+
avscript.WriteLine(@"LoadPlugin(PluginPath+""AutoCrop.dll"")");
2187+
}
2188+
2189+
21832190
if (SarCompensate)
21842191
avscript.WriteLine(new ResizeFilter(SarWidth, SarHeight));
21852192
avscript.Write(textBoxProcessingScript.Text);
@@ -2592,7 +2599,7 @@ void GenerateAvisynthScript()
25922599
script.AppendLine(Filters.MultipleTrim.ToString());
25932600
if (Filters.Rate != null && Filters.DynamicCrop == null)
25942601
script.AppendLine(Filters.Rate.Avisynth());
2595-
if (Filters.Crop != null && !boxFixSubs.Checked)
2602+
if (Filters.Crop != null && !boxFixSubs.Checked && Filters.CropBarsFilter == null)
25962603
{
25972604
script.AppendLine(Filters.Crop.ToString());
25982605
script.AppendLine(new ResizeFilter(Filters.Crop.finalWidth, Filters.Crop.finalHeight).ToString());
@@ -2607,6 +2614,8 @@ void GenerateAvisynthScript()
26072614
script.AppendLine(Filters.Rotate.ToString());
26082615
if (Filters.DelayAudio != null)
26092616
script.AppendLine(Filters.DelayAudio.ToString());
2617+
if (Filters.CropBarsFilter != null)
2618+
script.AppendLine(Filters.CropBarsFilter.ToString());
26102619

26112620
textBoxProcessingScript.Text = script.ToString();
26122621
}
@@ -2851,7 +2860,7 @@ private void EditMultiTrimFilter(object sender, EventArgs e)
28512860

28522861
private void EditCropFilter(object sender, EventArgs e)
28532862
{
2854-
using (var form = new CropForm(Filters.Crop))
2863+
using (var form = new CropForm(Filters.Crop, Filters.CropBarsFilter))
28552864
{
28562865
if (form.ShowDialog(this) == DialogResult.OK)
28572866
{

NewUpdate/3.34.0.zip

169 KB
Binary file not shown.

NewUpdate/latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.33.1
1+
3.34.0

Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static class Filters
3232
internal static SubtitleFilter Subtitle { get; set; }
3333
internal static TrimFilter Trim { get; set; }
3434
internal static DynamicFilter Dynamic { get; set; }
35+
internal static CropBarsFilter CropBarsFilter { get; set; }
3536

3637
internal static void ResetFilters()
3738
{
@@ -52,6 +53,7 @@ internal static void ResetFilters()
5253
Subtitle = null;
5354
Trim = null;
5455
Dynamic = null;
56+
CropBarsFilter = null;
5557
}
5658
}
5759

Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("3.33.1")]
34+
[assembly: AssemblyVersion("3.34.0")]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Drag and drop two or more video files inside the application, select what do you
217217
* Change Rate: ```Alt + Shift + c```
218218

219219
### Supporters
220+
* Chibi
220221
* bouteloua
221222
* ManletPride
222223
* 3nly
@@ -226,6 +227,13 @@ If you have any issues with this program, you may report them on [here][NewIssue
226227

227228
## Changelog
228229

230+
#### Version 3.34.0
231+
* Add feature to auto crop black bars, find the option in *Crop filter*. See related [request](https://github.com/argorar/WebMConverter/issues/61)
232+
233+
Special thanks to this month supporters:
234+
* ManletPride
235+
* new top supporter **Chibi** :heart:
236+
229237
#### Version 3.33.1
230238
* Add feature when click over trim timestamp start or end, preview will jump to the specific frame. See related [request](https://github.com/argorar/WebMConverter/issues/64)
231239

0 commit comments

Comments
 (0)