File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/ImageSharp/Metadata/Profiles/Exif Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments