Browse Source
Update src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs
Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1760/head
Ildar Khayrutdinov
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs
|
|
|
@ -49,8 +49,8 @@ namespace SixLabors.ImageSharp.Formats.Tiff |
|
|
|
|
|
|
|
private static ByteOrder ReadByteOrder(Stream stream) |
|
|
|
{ |
|
|
|
byte[] headerBytes = new byte[2]; |
|
|
|
stream.Read(headerBytes, 0, 2); |
|
|
|
Span<byte> headerBytes = stackalloc byte[2]; |
|
|
|
stream.Read(headerBytes); |
|
|
|
if (headerBytes[0] == TiffConstants.ByteOrderLittleEndian && headerBytes[1] == TiffConstants.ByteOrderLittleEndian) |
|
|
|
{ |
|
|
|
return ByteOrder.LittleEndian; |
|
|
|
|