This is a quick Imgur fix, and reducing the amount of traffic.

This commit is contained in:
Robin 2016-11-03 21:51:27 +01:00
commit a9a745a439
22 changed files with 1136 additions and 757 deletions

View file

@ -25,13 +25,10 @@ using Greenshot.Plugin.Drawing;
using GreenshotPlugin.Core;
using GreenshotPlugin.UnmanagedHelpers;
using System.Drawing.Drawing2D;
using log4net;
namespace Greenshot.Drawing.Filters {
[Serializable()]
[Serializable]
public class BlurFilter : AbstractFilter {
private static ILog LOG = LogManager.GetLogger(typeof(BlurFilter));
public double previewQuality;
public double PreviewQuality {
get { return previewQuality; }
@ -43,7 +40,7 @@ namespace Greenshot.Drawing.Filters {
AddField(GetType(), FieldType.PREVIEW_QUALITY, 1.0d);
}
public unsafe override void Apply(Graphics graphics, Bitmap applyBitmap, Rectangle rect, RenderMode renderMode) {
public override void Apply(Graphics graphics, Bitmap applyBitmap, Rectangle rect, RenderMode renderMode) {
int blurRadius = GetFieldValueAsInt(FieldType.BLUR_RADIUS);
Rectangle applyRect = ImageHelper.CreateIntersectRectangle(applyBitmap.Size, rect, Invert);
if (applyRect.Width == 0 || applyRect.Height == 0) {
@ -54,7 +51,7 @@ namespace Greenshot.Drawing.Filters {
graphics.SetClip(applyRect);
graphics.ExcludeClip(rect);
}
if (GDIplus.isBlurPossible(blurRadius)) {
if (GDIplus.IsBlurPossible(blurRadius)) {
GDIplus.DrawWithBlur(graphics, applyBitmap, applyRect, null, null, blurRadius, false);
} else {
using (IFastBitmap fastBitmap = FastBitmap.CreateCloneOf(applyBitmap, applyRect)) {
@ -63,7 +60,6 @@ namespace Greenshot.Drawing.Filters {
}
}
graphics.Restore(state);
return;
}
}
}