Skip to content

Commit 918db05

Browse files
add missing file
1 parent 5649128 commit 918db05

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using System;
5+
using System.Text;
6+
7+
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
8+
{
9+
internal static class ExifUcs2StringHelpers
10+
{
11+
private static Encoding Ucs2Encoding => Encoding.GetEncoding("UCS-2");
12+
13+
public static bool IsUcs2Tag(ExifTagValue tag)
14+
{
15+
switch (tag)
16+
{
17+
case ExifTagValue.XPAuthor:
18+
case ExifTagValue.XPComment:
19+
case ExifTagValue.XPKeywords:
20+
case ExifTagValue.XPSubject:
21+
case ExifTagValue.XPTitle:
22+
return true;
23+
default:
24+
return false;
25+
}
26+
}
27+
28+
public static string ConvertToString(ReadOnlySpan<byte> buffer) => Ucs2Encoding.GetString(buffer);
29+
}
30+
}

0 commit comments

Comments
 (0)