From 3b0b08b645ca82a13f213f9098be58cf522ab39b Mon Sep 17 00:00:00 2001 From: James South Date: Thu, 30 Oct 2014 22:39:14 +0000 Subject: [PATCH] Only need on instance of ImageConverter Former-commit-id: a35ae46486ca8630663668dcd2fa60648fdd8832 Former-commit-id: 08a0cf520fe3e92654ed22ef168c820ba728836f --- src/ImageProcessor/Imaging/Formats/GifEncoder.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/Imaging/Formats/GifEncoder.cs b/src/ImageProcessor/Imaging/Formats/GifEncoder.cs index 89a2ec9083..03af3af5ec 100644 --- a/src/ImageProcessor/Imaging/Formats/GifEncoder.cs +++ b/src/ImageProcessor/Imaging/Formats/GifEncoder.cs @@ -111,6 +111,12 @@ namespace ImageProcessor.Imaging.Formats #endregion #region Fields + + /// + /// The converter for creating the output image from a byte array. + /// + private static readonly ImageConverter Converter = new ImageConverter(); + /// /// The stream. /// @@ -244,8 +250,7 @@ namespace ImageProcessor.Imaging.Formats this.imageStream.Flush(); this.imageStream.Position = 0; byte[] bytes = this.imageStream.ToArray(); - ImageConverter converter = new ImageConverter(); - return (Image)converter.ConvertFrom(bytes); + return (Image)Converter.ConvertFrom(bytes); } #endregion