From e924a6d2ce1dbd75fa20bfa330deb289d46bf06c 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: 97d0d2a61bdb7e980f94847e6abd30381f9dbf52 Former-commit-id: f4e05c6674ef63bde6a607f0e2bb28a6f724372a --- 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 89a2ec908..03af3af5e 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