mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[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:
@@ -2,28 +2,24 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using Common.ComInterlop;
|
||||
using Microsoft.PowerToys.STATestExtension;
|
||||
using Microsoft.PowerToys.ThumbnailHandler.Gcode;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
|
||||
namespace GcodeThumbnailProviderUnitTests
|
||||
{
|
||||
[STATestClass]
|
||||
public class GcodeThumbnailProviderTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void GetThumbnailValidStreamGcode()
|
||||
[DataTestMethod]
|
||||
[DataRow("HelperFiles/sample.gcode")]
|
||||
[DataRow("HelperFiles/sample_JPG.gcode")]
|
||||
[DataRow("HelperFiles/sample_QOI.gcode")]
|
||||
public void GetThumbnailValidStreamGcode(string filePath)
|
||||
{
|
||||
// Act
|
||||
var filePath = "HelperFiles/sample.gcode";
|
||||
|
||||
GcodeThumbnailProvider provider = new GcodeThumbnailProvider(filePath);
|
||||
|
||||
Bitmap bitmap = provider.GetThumbnail(256);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="HelperFiles\sample.gcode" />
|
||||
<None Remove="HelperFiles\sample_JPG.gcode" />
|
||||
<None Remove="HelperFiles\sample_QOI.gcode" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -44,5 +46,11 @@
|
||||
<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>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user