Example #1
0
        public static ImageType ToImageType(string mimeType)
        {
            foreach (var keyValuePair in ImageToMimeTypeMap)
            {
                ImageType imageType = keyValuePair.Key;
                string[]  mimeTypes = keyValuePair.Value;

                if (mimeTypes.Contains(mimeType, StringComparer.OrdinalIgnoreCase))
                {
                    return(imageType);
                }
            }

            Verifiers.Verify(false, "Unknown mime type name: {0}", mimeType);
            return(default(ImageType));
        }
Example #2
0
 public ImageChecker(byte[] data)
 {
     Verifiers.ArgNullVerify(data, nameof(data));
     _data = data;
 }