Browse Source

Update src/ImageSharp/Metadata/Profiles/Exif/ExifConstants.cs

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1935/head
Ildar Khayrutdinov 4 years ago
committed by GitHub
parent
commit
06e1d8b39d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/ImageSharp/Metadata/Profiles/Exif/ExifConstants.cs

3
src/ImageSharp/Metadata/Profiles/Exif/ExifConstants.cs

@ -14,7 +14,8 @@ namespace SixLabors.ImageSharp.Metadata.Profiles.Exif
private const ulong UnicodeCode = 0x_55_4E_49_43_4F_44_45_00;
private const ulong UndefinedCode = 0x_00_00_00_00_00_00_00_00;
private static readonly byte[] AsciiCodeBytes = { 0x41, 0x53, 0x43, 0x49, 0x49, 0, 0, 0 };
// This uses C# compiler's optimization to refer to the data segment directly. No allocation occurs.
private static ReadOnlySpan<byte> AsciiCodeBytes => new byte[] { 0x41, 0x53, 0x43, 0x49, 0x49, 0, 0, 0 };
private static readonly byte[] JISCodeBytes = { 0x4A, 0x49, 0x53, 0, 0, 0, 0, 0 };
private static readonly byte[] UnicodeCodeBytes = { 0x55, 0x4E, 0x49, 0x43, 0x4F, 0x44, 0x45, 0 };
private static readonly byte[] UndefinedCodeBytes = { 0, 0, 0, 0, 0, 0, 0, 0 };

Loading…
Cancel
Save