private static FileInfo GetJacketImage(JacketSize jacketSize, DirectoryInfo dir) { var size = jacketSize.GetDimensions(); var files = dir.GetFiles("*.jpg", SearchOption.AllDirectories) .Where(info => FileUtils.ImageFromFile(info.FullName).Size.Equals(size)) .ToArray(); return(files.FirstOrDefault()); }
public static Size GetDimensions(this JacketSize jacketSize) { return(jacketSize.GetAttributeProperty <SizeAttribute, Size>(attribute => attribute.Size)); }
private static FileInfo GetJacketImage(JacketSize jacketSize, DirectoryInfo dir) { var size = jacketSize.GetDimensions(); var files = dir.GetFiles("*.jpg", SearchOption.AllDirectories) .Where(info => FileUtils.ImageFromFile(info.FullName).Size.Equals(size)) .ToArray(); return files.FirstOrDefault(); }