public List <string> ValidateImageLinks() { var errors = new List <string>(UnusedImages.Select(item => $"Image '{item.AbsolutePath}' is not used")); errors.AddRange(MissingImages.Select(item => $"Image '{item}' is missing")); return(errors); }
public void RebuildImageUseIndexes() { UnusedImages.Clear(); ImagesUsedIndex.Clear(); foreach (var item in Opf.GetPageItems()) { item.AddImagesTo(ImagesUsedIndex); } MissingImages = new HashSet <string>(ImagesUsedIndex.Keys); foreach (var item in Opf.GetImageItems()) { if (ImagesUsedIndex.ContainsKey(item.AbsolutePath)) { MissingImages.Remove(item.AbsolutePath); } else { UnusedImages.Add(item); } } }