From d90b9d40ef0909c89f8ad7df0dd8a9cce0402d0b Mon Sep 17 00:00:00 2001 From: maxluli Date: Wed, 14 Sep 2022 19:59:27 +0200 Subject: [PATCH] Fixed the bug where the chrono would not reset if an effect was applied twice on the same image --- AgraV2/EffectGrayScale.cs | 3 +++ AgraV2/EffectMedianFilter.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/AgraV2/EffectGrayScale.cs b/AgraV2/EffectGrayScale.cs index 58135c8..1be925c 100644 --- a/AgraV2/EffectGrayScale.cs +++ b/AgraV2/EffectGrayScale.cs @@ -23,6 +23,9 @@ namespace AgraV2 if (inputBmp == null) return null; + //This is important for when the user wants to re apply an effet + ProcessingDuration = new List(); + Bitmap[] result = new Bitmap[] { useGetSetPixel(inputBmp), useByteArray(inputBmp), usePointers(inputBmp)}; return result; } diff --git a/AgraV2/EffectMedianFilter.cs b/AgraV2/EffectMedianFilter.cs index bc060f0..9f301f3 100644 --- a/AgraV2/EffectMedianFilter.cs +++ b/AgraV2/EffectMedianFilter.cs @@ -46,6 +46,12 @@ namespace AgraV2 } public override Bitmap[] apply(Bitmap inputBmp) { + if (inputBmp == null) + return null; + + //This is important for when the user wants to re apply an effet + ProcessingDuration = new List(); + Bitmap[] result = new Bitmap[] { medianFilter(inputBmp) }; return result; }