Browse Source

revert Frame Dispose

pull/2082/head
Scott Williams 4 years ago
parent
commit
558ff99b08
  1. 35
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

35
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -187,27 +187,20 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
where TPixel : unmanaged, IPixel<TPixel> where TPixel : unmanaged, IPixel<TPixel>
{ {
using var spectralConverter = new SpectralConverter<TPixel>(this.Configuration); using var spectralConverter = new SpectralConverter<TPixel>(this.Configuration);
try
{ var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken);
var scanDecoder = new HuffmanScanDecoder(stream, spectralConverter, cancellationToken);
this.ParseStream(stream, scanDecoder, cancellationToken);
this.ParseStream(stream, scanDecoder, cancellationToken); this.InitExifProfile();
this.InitExifProfile(); this.InitIccProfile();
this.InitIccProfile(); this.InitIptcProfile();
this.InitIptcProfile(); this.InitXmpProfile();
this.InitXmpProfile(); this.InitDerivedMetadataProperties();
this.InitDerivedMetadataProperties();
return new Image<TPixel>(
return new Image<TPixel>( this.Configuration,
this.Configuration, spectralConverter.GetPixelBuffer(cancellationToken),
spectralConverter.GetPixelBuffer(cancellationToken), this.Metadata);
this.Metadata);
}
catch
{
this.Frame?.Dispose();
throw;
}
} }
/// <inheritdoc/> /// <inheritdoc/>

Loading…
Cancel
Save