Made the supported image formats extendable, and supplied a SVG implementation right away with the jira addon.

This commit is contained in:
Robin 2016-09-05 22:48:23 +02:00
commit fc192827f1
21 changed files with 1354 additions and 676 deletions

View file

@ -23,9 +23,13 @@ using System.Windows.Forms;
using Greenshot.IniFile;
using Greenshot.Plugin;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Threading.Tasks;
using Dapplo.Log.Facade;
using GreenshotJiraPlugin.Forms;
using GreenshotPlugin.Core;
using Svg;
namespace GreenshotJiraPlugin {
/// <summary>
@ -95,6 +99,21 @@ namespace GreenshotJiraPlugin {
_config = IniConfig.GetIniSection<JiraConfiguration>();
LogSettings.RegisterDefaultLogger<Log4NetLogger>();
// Add a SVG converter, although it doesn't fit to the Jira plugin there is currently no other way
ImageHelper.StreamConverters["svg"] = (stream, s) =>
{
stream.Position = 0;
try
{
return SvgImage.FromStream(stream).Image;
}
catch (Exception ex)
{
Log.Error("Can't load SVG", ex);
}
return null;
};
return true;
}