mirror of https://github.com/SixLabors/ImageSharp
1 changed files with 30 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
using System; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Metadata.Profiles.Exif |
||||
|
{ |
||||
|
internal static class ExifUcs2StringHelpers |
||||
|
{ |
||||
|
private static Encoding Ucs2Encoding => Encoding.GetEncoding("UCS-2"); |
||||
|
|
||||
|
public static bool IsUcs2Tag(ExifTagValue tag) |
||||
|
{ |
||||
|
switch (tag) |
||||
|
{ |
||||
|
case ExifTagValue.XPAuthor: |
||||
|
case ExifTagValue.XPComment: |
||||
|
case ExifTagValue.XPKeywords: |
||||
|
case ExifTagValue.XPSubject: |
||||
|
case ExifTagValue.XPTitle: |
||||
|
return true; |
||||
|
default: |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static string ConvertToString(ReadOnlySpan<byte> buffer) => Ucs2Encoding.GetString(buffer); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue