Browse Source

Remove excess extension.

Former-commit-id: dfc11ff2e5491cd114583461ac43fab91615f4d9
Former-commit-id: 917d752bcafd9a47c1621d42a7d92f3991a9c64d
Former-commit-id: 8d80a2f9c52b0144e7090e3312b9ee376ec793fb
af/merge-core
James South 10 years ago
parent
commit
3dbf9fd5fe
  1. 16
      src/ImageProcessorCore/ImageExtensions.cs
  2. 1
      src/ImageProcessorCore/project.json

16
src/ImageProcessorCore/ImageExtensions.cs

@ -10,7 +10,6 @@ namespace ImageProcessorCore
using Formats;
using ImageProcessorCore.Quantizers;
using ImageProcessorCore.Samplers;
/// <summary>
@ -52,21 +51,6 @@ namespace ImageProcessorCore
/// <exception cref="ArgumentNullException">Thrown if the stream is null.</exception>
public static void SaveAsGif(this ImageBase source, Stream stream, int quality = 256) => new GifEncoder { Quality = quality }.Encode(source, stream);
/// <summary>
/// Returns a Base64 encoded string from the given image.
/// </summary>
/// <param name="source">The image this method extends.</param>
/// <returns>The <see cref="string"/></returns>
public static string ToBase64String(this Image source)
{
using (MemoryStream stream = new MemoryStream())
{
source.Save(stream);
stream.Flush();
return $"data:{source.CurrentImageFormat.Encoder.MimeType};base64,{Convert.ToBase64String(stream.ToArray())}";
}
}
/// <summary>
/// Applies the collection of processors to the image.
/// <remarks>This method does not resize the target image.</remarks>

1
src/ImageProcessorCore/project.json

@ -23,7 +23,6 @@
"System.Runtime.Extensions": "4.0.11-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.IO": "4.0.11-beta-23516",
"StyleCop.Analyzers": "1.0.0",
"Microsoft.NETCore": "5.0.1-beta-23516",
"Microsoft.NETCore.Platforms": "1.0.1-beta-23516"
},

Loading…
Cancel
Save