public ImageInfo(string id, IImageFormat format, Image image) { if (image == null) { throw new UnknownImageFormatException("Missing image"); } Id = id; Format = format; Width = image.Width; Height = image.Height; ColorTable = new ImageCalculate(image).ColorTable; }
private bool ValidateImage(string fileName) { try { using (Image image = Image.Load(fileName, out IImageFormat format)) { Width = image.Width; Height = image.Height; Format = format; ColorTable = new ImageCalculate(image).ColorTable; return(true); } } catch (UnknownImageFormatException) { return(false); } }