Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 - Clear Pixel Buffers on Decode. #2717

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
this.pixelBuffer = allocator.Allocate2D<TPixel>(
frame.PixelWidth,
frame.PixelHeight,
this.configuration.PreferContiguousImageBuffers);
this.configuration.PreferContiguousImageBuffers,
AllocationOptions.Clean);
this.paddedProxyPixelRow = allocator.Allocate<TPixel>(frame.PixelWidth + 3);

// component processors from spectral to Rgba32
Expand Down Expand Up @@ -215,4 +216,4 @@
this.pixelBuffer?.Dispose();
}
}
}
}

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, net5.0, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, netcoreapp3.1, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, net6.0, 6.0.x, true, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, net5.0, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, netcoreapp2.1, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, net6.0, 6.0.x, true, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, net472, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, netcoreapp3.1, -x64, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (windows-latest, net472, -x86, false)

File is required to end with a single newline character

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest, netcoreapp3.1, -x64, false)

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest, net5.0, -x64, false)

Check warning on line 219 in src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

View workflow job for this annotation

GitHub Actions / Build (macos-latest, net6.0, 6.0.x, true, -x64, false)

2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Tga/TgaDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public Image<TPixel> Decode<TPixel>(BufferedReadStream stream, CancellationToken
throw new UnknownImageFormatException("Width or height cannot be 0");
}

var image = Image.CreateUninitialized<TPixel>(this.Configuration, this.fileHeader.Width, this.fileHeader.Height, this.metadata);
Image<TPixel> image = new(this.Configuration, this.fileHeader.Width, this.fileHeader.Height, this.metadata);
Buffer2D<TPixel> pixels = image.GetRootFramePixelBuffer();

if (this.fileHeader.ColorMapType == 1)
Expand Down
Loading