[FileExplorerAddOns]Improves handling of Gcode Thumbnails (#27947)

* Improves handling of Gcode Thumbnails

* Remove Peek support

* Moves GcodeHelper to PreviewHandlerCommon

* Reverts minor change

* Skip unknown data on GcodeHelper.GetBestThumbnail

* Replaces QOI.Core with QoiImage

* Fixes spellchecker

* Reverts changes to NOTICE.md

* Minor QoiImage improvements

* Use custom QoiPixel struct

* Add MIT notice for the QOI reference code

* Fix spellcheck for the MIT notice

* Update NOTICE.md

tweaked notice a bit
This commit is contained in:
Pedro Lamas
2023-09-19 15:33:55 +01:00
committed by GitHub
parent cc454701b8
commit 4ba1d83cf5
22 changed files with 103394 additions and 55303 deletions

View File

@@ -19,14 +19,17 @@ namespace GcodePreviewHandlerUnitTests
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2201:Do not raise reserved exception types", Justification = "new Exception() is fine in test projects.")]
public class GcodePreviewHandlerTest
{
[TestMethod]
public void GcodePreviewHandlerControlAddsControlsToFormWhenDoPreviewIsCalled()
[DataTestMethod]
[DataRow("HelperFiles/sample.gcode")]
[DataRow("HelperFiles/sample_JPG.gcode")]
[DataRow("HelperFiles/sample_QOI.gcode")]
public void GcodePreviewHandlerControlAddsControlsToFormWhenDoPreviewIsCalled(string filePath)
{
// Arrange
using (var gcodePreviewHandlerControl = new GcodePreviewHandlerControl())
{
// Act
var file = File.ReadAllBytes("HelperFiles/sample.gcode");
var file = File.ReadAllBytes(filePath);
gcodePreviewHandlerControl.DoPreview<IStream>(GetMockStream(file));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,8 @@
<ItemGroup>
<None Remove="HelperFiles\sample.gcode" />
<None Remove="HelperFiles\sample_JPG.gcode" />
<None Remove="HelperFiles\sample_QOI.gcode" />
</ItemGroup>
<ItemGroup>
@@ -41,6 +43,12 @@
<Content Include="HelperFiles\sample.gcode">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="HelperFiles\sample_JPG.gcode">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="HelperFiles\sample_QOI.gcode">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Compile Include="..\STATestClassAttribute.cs" Link="STATestClassAttribute.cs" />
<Compile Include="..\STATestMethodAttribute.cs" Link="STATestMethodAttribute.cs" />
</ItemGroup>