Browse Source

Fix decoder scope issue

Former-commit-id: 2af59fd59accf07b10c3d0d0d618336783fd93b0
Former-commit-id: a400a82f238ce53c4fefbe5d4ccc446656d31685
Former-commit-id: 42525e35c1de995b2b453cfff2b82d05294516ad
pull/17/head
James Jackson-South 11 years ago
parent
commit
b4a2807649
  1. 27
      src/ImageProcessor/Formats/Gif/GifDecoderCore.cs

27
src/ImageProcessor/Formats/Gif/GifDecoderCore.cs

@ -405,20 +405,19 @@ namespace ImageProcessor.Formats
{
if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToBackground)
{
Parallel.For(descriptor.Top, descriptor.Top + descriptor.Height,
y =>
{
for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++)
{
offset = ((y * imageWidth) + x) * 4;
// Stored in r-> g-> b-> a order.
this.currentFrame[offset + 0] = 0;
this.currentFrame[offset + 1] = 0;
this.currentFrame[offset + 2] = 0;
this.currentFrame[offset + 3] = 0;
}
});
for (int y = descriptor.Top; y < descriptor.Top + descriptor.Height; y++)
{
for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++)
{
offset = ((y * imageWidth) + x) * 4;
// Stored in r-> g-> b-> a order.
this.currentFrame[offset + 0] = 0;
this.currentFrame[offset + 1] = 0;
this.currentFrame[offset + 2] = 0;
this.currentFrame[offset + 3] = 0;
}
}
}
else if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToPrevious)
{

Loading…
Cancel
Save