Skip to content

Commit 6d6377f

Browse files
committed
v0.14.1
1 parent c784500 commit 6d6377f

File tree

8 files changed

+27
-12
lines changed

8 files changed

+27
-12
lines changed

build/Common.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
</PropertyGroup>
5858

5959
<ItemGroup Condition="'$(Configuration)'=='Dist' Or '$(Configuration)'=='Coverage'">
60-
<None Include="$(MSBuildThisFileDirectory)$(Company).png" Pack="true" PackagePath="/" />
61-
<None Include="$(ProjectRoot)readme.md" Pack="true" PackagePath="/" />
60+
<None Include="$(MSBuildThisFileDirectory)$(PackageIcon)" Pack="true" PackagePath="/" />
61+
<None Include="$(ProjectRoot)$(PackageReadmeFile)" Pack="true" PackagePath="/" />
6262
<None Include="$(RepositoryRoot)license" Pack="true" PackagePath="/" />
6363
<None Include="$(RepositoryRoot)third-party-notices" Pack="true" PackagePath="/" />
6464
<SourceRoot Include="$(RepositoryRoot)" />

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</ItemGroup>
3232

3333
<ItemGroup Condition="'$(Configuration)'=='Dist'">
34-
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.0" PrivateAssets="all" />
34+
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.1" PrivateAssets="all" />
3535
</ItemGroup>
3636

3737
<ItemGroup Condition="'$(Configuration)'!='Dist'">

src/Directory.Build.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
<ItemGroup>
2323
<_ProjectReferencesWithExactVersions Include="@(_ProjectReferencesWithVersions)">
2424
<ProjectVersion>[$([System.Text.RegularExpressions.Regex]::Match('%(_ProjectReferencesWithVersions.ProjectVersion)', '^\d+\.\d+\.\d+').Value),$([MSBuild]::Add($([System.Text.RegularExpressions.Regex]::Match('%(_ProjectReferencesWithVersions.ProjectVersion)', '^\d+\.\d+').Value), '0.01').ToString('f2')))</ProjectVersion>
25-
<ProjectVersion Condition="'$(VersionSuffix)'!=''">[%(_ProjectReferencesWithVersions.ProjectVersion)]</ProjectVersion>
25+
<ProjectVersion Condition="'$(VersionSuffix)'!=''">[$([System.Text.RegularExpressions.Regex]::Match('%(_ProjectReferencesWithVersions.ProjectVersion)', '^\d+\.\d+\.\d+').Value)]</ProjectVersion>
26+
<ProjectVersion Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(%(_ProjectReferencesWithVersions.ProjectVersion), '-ci\d+$'))">[%(_ProjectReferencesWithVersions.ProjectVersion)]</ProjectVersion>
2627
</_ProjectReferencesWithExactVersions>
2728
</ItemGroup>
2829

src/MagicScaler/Magic/ColorProfileTransform.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright © Clinton Ingram and Contributors. Licensed under the MIT License.
22

33
using System;
4+
using System.Runtime.InteropServices;
45
using System.Diagnostics.CodeAnalysis;
56

67
using static PhotoSauce.Interop.Lcms.Lcms;
@@ -15,6 +16,9 @@ internal sealed unsafe class ColorProfileTransform(PixelSource source, PixelForm
1516
public static bool HaveLcms => dependencyValid.Value;
1617

1718
private static readonly Lazy<bool> dependencyValid = new(() => {
19+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !AppConfig.EnableWindowsLcms)
20+
return false;
21+
1822
try
1923
{
2024
if (cmsGetEncodedCMMversion() is >= 2090 and < 3000)

src/MagicScaler/MagicScaler.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<VersionPrefix>0.14.1</VersionPrefix>
@@ -54,6 +54,10 @@
5454
<EmbeddedResource Include="$(BaseModulesPath)CompactProfiles\profiles\CGATS001Compat-v2-micro.icc" Link="Resources\%(FileName)%(Extension)" />
5555
</ItemGroup>
5656

57+
<ItemGroup>
58+
<None Include="Package\build\*" Pack="true" PackagePath="build/netcoreapp3.0/;buildTransitive/netcoreapp3.0/" />
59+
</ItemGroup>
60+
5761
<ItemGroup>
5862
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
5963
<None Update="Magic\Processors\Convolvers.tt" LastGenOutput="Convolvers.cs" Generator="TextTemplatingFileGenerator" />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project InitialTargets="_MagicScalerTfmSupportWarning">
2+
<Target Name="_MagicScalerTfmSupportWarning" Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
3+
<Warning Text="MagicScaler is no longer hardware accelerated on $(TargetFramework). Upgrade your TargetFramework to net6.0 or later (or use an older version of the library) for the best performance. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning." />
4+
</Target>
5+
</Project>

src/MagicScaler/Utilities/AppConfig.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ internal class AppConfig
99
{
1010
private const string prefix = $"{nameof(PhotoSauce)}.{nameof(MagicScaler)}";
1111

12-
public const string MaxPooledBufferSizeName = $"{prefix}.{nameof(MaxPooledBufferSize)}";
13-
public const string EnablePixelSourceStatsName = $"{prefix}.{nameof(EnablePixelSourceStats)}";
14-
public const string ThrowOnFinalizerName = $"{prefix}.{nameof(ThrowOnFinalizer)}";
15-
16-
public static readonly int MaxPooledBufferSize = getAppContextInt(MaxPooledBufferSizeName);
17-
public static readonly bool EnablePixelSourceStats = AppContext.TryGetSwitch(EnablePixelSourceStatsName, out bool val) && val;
18-
public static readonly bool ThrowOnFinalizer = AppContext.TryGetSwitch(ThrowOnFinalizerName, out bool val) && val;
12+
public static readonly int MaxPooledBufferSize = getAppContextInt($"{prefix}.{nameof(MaxPooledBufferSize)}");
13+
public static readonly bool EnablePixelSourceStats = AppContext.TryGetSwitch($"{prefix}.{nameof(EnablePixelSourceStats)}", out bool val) && val;
14+
public static readonly bool GdsMitigationsDisabled = AppContext.TryGetSwitch($"{prefix}.{nameof(GdsMitigationsDisabled)}", out bool val) && val;
15+
public static readonly bool EnableWindowsLcms = AppContext.TryGetSwitch($"{prefix}.{nameof(EnableWindowsLcms)}", out bool val) && val;
16+
public static readonly bool ThrowOnFinalizer = AppContext.TryGetSwitch($"{prefix}.{nameof(ThrowOnFinalizer)}", out bool val) && val;
1917

2018
private static int getAppContextInt(string name)
2119
{

src/MagicScaler/Utilities/HWIntrinsics.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public static int VectorCount<T>() where T : struct =>
4040

4141
private static bool getFastGather()
4242
{
43+
if (!AppConfig.GdsMitigationsDisabled)
44+
return false;
45+
4346
bool intel = X86Base.CpuId(0, 0) is (_, 0x756e6547, 0x6c65746e, 0x49656e69); // "Genu", "ntel", "ineI"
4447
uint fms = (uint)X86Base.CpuId(1, 0).Eax;
4548
uint fam = ((fms & 0xfu << 20) >> 16) + ((fms & 0xfu << 8) >> 8);

0 commit comments

Comments
 (0)