.editorconfig
JSON002
Private
IDE0230
Use Immich assets for random
This commit is contained in:
2024-05-11 14:23:01 -07:00
parent c9dbce3b57
commit bf2d6849b3
26 changed files with 215 additions and 63 deletions

View File

@ -81,6 +81,7 @@ internal abstract class ImageHelper
internal static Size GetDimensions(BinaryReader binaryReader, int? faceRight, int? faceBottom)
{
Size? result = null;
#pragma warning disable IDE0230
Dictionary<byte[], Func<BinaryReader, Size>> _ImageFormatDecoders = new()
{
{ new byte[] { 0x42, 0x4D }, DecodeBitmap },
@ -89,6 +90,7 @@ internal abstract class ImageHelper
{ new byte[] { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }, DecodePng },
{ new byte[] { 0xff, 0xd8 }, DecodeJfif },
};
#pragma warning restore IDE0230
int maxMagicBytesLength = _ImageFormatDecoders.Keys.OrderByDescending(x => x.Length).First().Length;
byte[] magicBytes = new byte[maxMagicBytesLength];
for (int i = 0; i < maxMagicBytesLength; i += 1)