Browse Source

assembly trimming support

pull/2160/head
Jeremy Pritts 4 years ago
parent
commit
3330b27b31
  1. 2
      src/ImageSharp/ImageSharp.csproj
  2. 2
      src/ImageSharp/Metadata/Profiles/Exif/ExifTagDescriptionAttribute.cs

2
src/ImageSharp/ImageSharp.csproj

@ -24,11 +24,13 @@
<When Condition="$(SIXLABORS_TESTING_PREVIEW) == true">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
</Otherwise>
</Choose>

2
src/ImageSharp/Metadata/Profiles/Exif/ExifTagDescriptionAttribute.cs

@ -32,7 +32,7 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
public static string GetDescription(ExifTag tag, object value)
{
var tagValue = (ExifTagValue)(ushort)tag;
FieldInfo field = tagValue.GetType().GetTypeInfo().GetDeclaredField(tagValue.ToString());
FieldInfo field = typeof(ExifTagValue).GetField(tagValue.ToString(), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
if (field is null)
{

Loading…
Cancel
Save