diff --git a/ImageSharp.Textures.sln b/ImageSharp.Textures.sln
index 636514f8..7568b07c 100644
--- a/ImageSharp.Textures.sln
+++ b/ImageSharp.Textures.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29613.14
+# Visual Studio Version 18
+VisualStudioVersion = 18.5.11716.220
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Textures", "src\ImageSharp.Textures\ImageSharp.Textures.csproj", "{1588F6C4-2186-4A35-9693-E9F296791393}"
EndProject
@@ -50,13 +50,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProjectSection
EndProject
Global
- GlobalSection(SharedMSBuildProjectFiles) = preSolution
- shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{1588f6c4-2186-4a35-9693-e9f296791393}*SharedItemsImports = 5
- tests\Images\Images.projitems*{17fcbd4d-d232-45e8-876f-dfbc2fad52cf}*SharedItemsImports = 5
- tests\Images\Images.projitems*{18be79b6-6b95-4ed7-a963-ad75f6cb9f3c}*SharedItemsImports = 5
- tests\Images\Images.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13
- tests\Images\Images.projitems*{b159ffd1-e646-42d0-892c-4abf69103712}*SharedItemsImports = 5
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
@@ -94,4 +87,11 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F1762A0D-74C4-454A-BCB7-C010BB067E58}
EndGlobalSection
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems*{1588f6c4-2186-4a35-9693-e9f296791393}*SharedItemsImports = 5
+ tests\Images\Images.projitems*{17fcbd4d-d232-45e8-876f-dfbc2fad52cf}*SharedItemsImports = 5
+ tests\Images\Images.projitems*{18be79b6-6b95-4ed7-a963-ad75f6cb9f3c}*SharedItemsImports = 5
+ tests\Images\Images.projitems*{68a8cc40-6aed-4e96-b524-31b1158fdeea}*SharedItemsImports = 13
+ tests\Images\Images.projitems*{b159ffd1-e646-42d0-892c-4abf69103712}*SharedItemsImports = 5
+ EndGlobalSection
EndGlobal
diff --git a/shared-infrastructure b/shared-infrastructure
index 57699ffb..4a5a9fe7 160000
--- a/shared-infrastructure
+++ b/shared-infrastructure
@@ -1 +1 @@
-Subproject commit 57699ffb797bc2389c5d6cbb3b1800f2eb5fb947
+Subproject commit 4a5a9fe756e75c92ef9042b0ea4d94bc35e6ace9
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 2813cc4b..aa98dc2e 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -11,7 +11,7 @@
-->
-
+
@@ -22,7 +22,6 @@
-
diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props
index 775062ad..527225fe 100644
--- a/tests/Directory.Build.props
+++ b/tests/Directory.Build.props
@@ -11,7 +11,7 @@
-->
-
+
diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets
index c88a39e7..8d0956c9 100644
--- a/tests/Directory.Build.targets
+++ b/tests/Directory.Build.targets
@@ -18,9 +18,9 @@
-
+
-
+
diff --git a/tests/ImageSharp.Textures.InteractiveTest/ImageSharp.Textures.InteractiveTest.csproj b/tests/ImageSharp.Textures.InteractiveTest/ImageSharp.Textures.InteractiveTest.csproj
index 08d6c73a..891d5645 100644
--- a/tests/ImageSharp.Textures.InteractiveTest/ImageSharp.Textures.InteractiveTest.csproj
+++ b/tests/ImageSharp.Textures.InteractiveTest/ImageSharp.Textures.InteractiveTest.csproj
@@ -10,6 +10,8 @@
SixLabors.ImageSharp.Textures.InteractiveTest
false
+
+ $(NoWarn);CS8002
diff --git a/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderFlatTests.cs b/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderFlatTests.cs
new file mode 100644
index 00000000..93fb4c62
--- /dev/null
+++ b/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderFlatTests.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Six Labors.
+// Licensed under the Six Labors Split License.
+
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Textures.Formats.Ktx;
+using SixLabors.ImageSharp.Textures.Tests.Enums;
+using SixLabors.ImageSharp.Textures.Tests.TestUtilities;
+using SixLabors.ImageSharp.Textures.Tests.TestUtilities.Attributes;
+using SixLabors.ImageSharp.Textures.Tests.TestUtilities.TextureProviders;
+using SixLabors.ImageSharp.Textures.TextureFormats;
+
+namespace SixLabors.ImageSharp.Textures.Tests.Formats.Ktx;
+
+[GroupOutput("Ktx")]
+[Trait("Format", "Ktx")]
+public class KtxDecoderFlatTests
+{
+ private static readonly KtxDecoder KtxDecoder = new();
+
+ [Theory]
+ [WithFile(TestTextureFormat.Ktx, TestTextureType.Flat, TestTextureTool.PvrTexToolCli, TestImages.Ktx.Rgba32UnormMipMap)]
+ public void CanDecode_Rgba32_MipMaps(TestTextureProvider provider)
+ {
+ using Texture texture = provider.GetTexture(KtxDecoder);
+ provider.SaveTextures(texture);
+ FlatTexture flatTexture = texture as FlatTexture;
+
+ Assert.NotNull(flatTexture?.MipMaps);
+ Assert.Equal(8, flatTexture.MipMaps.Count);
+
+ int[] expectedSizes = [200, 100, 50, 25, 12, 6, 3, 1];
+ for (int i = 0; i < expectedSizes.Length; i++)
+ {
+ using Image mipImage = flatTexture.MipMaps[i].GetImage();
+ Assert.Equal(expectedSizes[i], mipImage.Height);
+ Assert.Equal(expectedSizes[i], mipImage.Width);
+ }
+
+ using Image firstMipMap = flatTexture.MipMaps[0].GetImage();
+ Assert.Equal(32, firstMipMap.PixelType.BitsPerPixel);
+ Image firstMipMapImage = firstMipMap as Image;
+ firstMipMapImage.CompareToReferenceOutput(provider, appendPixelTypeToFileName: false);
+ }
+}
diff --git a/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderTests.cs b/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderTests.cs
deleted file mode 100644
index 1fbacc67..00000000
--- a/tests/ImageSharp.Textures.Tests/Formats/Ktx/KtxDecoderTests.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) Six Labors.
-// Licensed under the Six Labors Split License.
-
-using SixLabors.ImageSharp.PixelFormats;
-using SixLabors.ImageSharp.Textures.Formats.Ktx;
-using SixLabors.ImageSharp.Textures.Tests.Enums;
-using SixLabors.ImageSharp.Textures.Tests.TestUtilities;
-using SixLabors.ImageSharp.Textures.Tests.TestUtilities.Attributes;
-using SixLabors.ImageSharp.Textures.Tests.TestUtilities.TextureProviders;
-using SixLabors.ImageSharp.Textures.TextureFormats;
-using Xunit;
-
-namespace SixLabors.ImageSharp.Textures.Tests.Formats.Ktx
-{
- [Trait("Format", "Ktx")]
- public class KtxDecoderTests
- {
- private static readonly KtxDecoder KtxDecoder = new KtxDecoder();
-
- [Theory]
- [WithFile(TestTextureFormat.Ktx, TestTextureType.Flat, TestTextureTool.PvrTexToolCli, TestImages.Ktx.Rgba)]
- public void KtxDecoder_CanDecode_Rgba8888(TestTextureProvider provider)
- {
- using Texture texture = provider.GetTexture(KtxDecoder);
- provider.SaveTextures(texture);
- var flatTexture = texture as FlatTexture;
-
- Assert.NotNull(flatTexture?.MipMaps);
- Assert.Equal(8, flatTexture.MipMaps.Count);
- Assert.Equal(200, flatTexture.MipMaps[0].GetImage().Height);
- Assert.Equal(200, flatTexture.MipMaps[0].GetImage().Width);
- Assert.Equal(100, flatTexture.MipMaps[1].GetImage().Height);
- Assert.Equal(100, flatTexture.MipMaps[1].GetImage().Width);
- Assert.Equal(50, flatTexture.MipMaps[2].GetImage().Height);
- Assert.Equal(50, flatTexture.MipMaps[2].GetImage().Width);
- Assert.Equal(25, flatTexture.MipMaps[3].GetImage().Height);
- Assert.Equal(25, flatTexture.MipMaps[3].GetImage().Width);
- Assert.Equal(12, flatTexture.MipMaps[4].GetImage().Height);
- Assert.Equal(12, flatTexture.MipMaps[4].GetImage().Width);
- Assert.Equal(6, flatTexture.MipMaps[5].GetImage().Height);
- Assert.Equal(6, flatTexture.MipMaps[5].GetImage().Width);
- Assert.Equal(3, flatTexture.MipMaps[6].GetImage().Height);
- Assert.Equal(3, flatTexture.MipMaps[6].GetImage().Width);
- Assert.Equal(1, flatTexture.MipMaps[7].GetImage().Height);
- Assert.Equal(1, flatTexture.MipMaps[7].GetImage().Width);
- Image firstMipMap = flatTexture.MipMaps[0].GetImage();
- Assert.Equal(32, firstMipMap.PixelType.BitsPerPixel);
- var firstMipMapImage = firstMipMap as Image;
- firstMipMapImage.CompareToReferenceOutput(provider, appendPixelTypeToFileName: false);
- }
- }
-}
diff --git a/tests/ImageSharp.Textures.Tests/Formats/Ktx2/Ktx2DecoderFlatTests.cs b/tests/ImageSharp.Textures.Tests/Formats/Ktx2/Ktx2DecoderFlatTests.cs
index 05952bb2..32f42e04 100644
--- a/tests/ImageSharp.Textures.Tests/Formats/Ktx2/Ktx2DecoderFlatTests.cs
+++ b/tests/ImageSharp.Textures.Tests/Formats/Ktx2/Ktx2DecoderFlatTests.cs
@@ -26,7 +26,8 @@ public void Ktx2Decoder_LevelCountZero_DecodesBaseLevelMipMap(TestTextureProvide
FlatTexture flatTexture = texture as FlatTexture;
Assert.NotNull(flatTexture);
Assert.Single(flatTexture.MipMaps);
- Assert.Equal(256, flatTexture.MipMaps[0].GetImage().Width);
- Assert.Equal(256, flatTexture.MipMaps[0].GetImage().Height);
+ using Image mipImage = flatTexture.MipMaps[0].GetImage();
+ Assert.Equal(256, mipImage.Width);
+ Assert.Equal(256, mipImage.Height);
}
}
diff --git a/tests/ImageSharp.Textures.Tests/ImageSharp.Textures.Tests.csproj b/tests/ImageSharp.Textures.Tests/ImageSharp.Textures.Tests.csproj
index ac9c7c4c..a7e6504d 100644
--- a/tests/ImageSharp.Textures.Tests/ImageSharp.Textures.Tests.csproj
+++ b/tests/ImageSharp.Textures.Tests/ImageSharp.Textures.Tests.csproj
@@ -3,7 +3,6 @@
net8.0
True
- AnyCPU;x64;x86
SixLabors.ImageSharp.Textures.Tests
SixLabors.ImageSharp.Textures.Tests
true
diff --git a/tests/ImageSharp.Textures.Tests/TestImages.cs b/tests/ImageSharp.Textures.Tests/TestImages.cs
index 4280d5f2..f2460a53 100644
--- a/tests/ImageSharp.Textures.Tests/TestImages.cs
+++ b/tests/ImageSharp.Textures.Tests/TestImages.cs
@@ -10,7 +10,7 @@ public static class TestImages
{
public static class Ktx
{
- public const string Rgba = "rgba8888.ktx";
+ public const string Rgba32UnormMipMap = "rgba32-unorm-mipmap.ktx";
}
public static class Ktx2
diff --git a/tests/ImageSharp.Textures.Tests/TestUtilities/Attributes/WithFileAttribute.cs b/tests/ImageSharp.Textures.Tests/TestUtilities/Attributes/WithFileAttribute.cs
index b8eed784..8fd3c6cb 100644
--- a/tests/ImageSharp.Textures.Tests/TestUtilities/Attributes/WithFileAttribute.cs
+++ b/tests/ImageSharp.Textures.Tests/TestUtilities/Attributes/WithFileAttribute.cs
@@ -1,57 +1,69 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
using System.Reflection;
-using System.Text.RegularExpressions;
using SixLabors.ImageSharp.Textures.Tests.Enums;
using SixLabors.ImageSharp.Textures.Tests.TestUtilities.TextureProviders;
using Xunit.Sdk;
-namespace SixLabors.ImageSharp.Textures.Tests.TestUtilities.Attributes
+namespace SixLabors.ImageSharp.Textures.Tests.TestUtilities.Attributes;
+
+public class WithFileAttribute : DataAttribute
{
- public class WithFileAttribute : DataAttribute
+ private readonly TestTextureFormat textureFormat;
+ private readonly TestTextureType textureType;
+ private readonly TestTextureTool textureTool;
+ private readonly string inputFile;
+
+ public WithFileAttribute(TestTextureFormat textureFormat, TestTextureType textureType, TestTextureTool textureTool, string inputFile)
{
- private readonly TestTextureFormat textureFormat;
- private readonly TestTextureType textureType;
- private readonly TestTextureTool textureTool;
- private readonly string inputFile;
- private readonly bool isRegex;
+ this.textureFormat = textureFormat;
+ this.textureType = textureType;
+ this.textureTool = textureTool;
+ this.inputFile = inputFile;
+ }
- public WithFileAttribute(TestTextureFormat textureFormat, TestTextureType textureType, TestTextureTool textureTool, string inputFile, bool isRegex = false)
- {
- this.textureFormat = textureFormat;
- this.textureType = textureType;
- this.textureTool = textureTool;
- this.inputFile = inputFile;
- this.isRegex = isRegex;
- }
+ public override IEnumerable