Skip to content

Commit

Permalink
WebpP - don't instantiate right away
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-luberda committed Dec 15, 2017
1 parent 8a4f974 commit b16cf06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/FFImageLoading.Shared.IosMac/Decoders/WebPDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ namespace FFImageLoading.Decoders
{
public class WebPDecoder : IDecoder<PImage>
{
WebPCodec _decoder = new WebPCodec();
WebPCodec _decoder;

public Task<IDecodedImage<PImage>> DecodeAsync(Stream stream, string path, ImageSource source, ImageInformation imageInformation, TaskParameter parameters)
{
if (_decoder == null)
_decoder = new WebPCodec();

var result = new DecodedImage<PImage>();
result.Image = _decoder.Decode(stream);

Expand Down

0 comments on commit b16cf06

Please sign in to comment.