public void LoadImage(Record record) { this.LoadImage(record.FullPath); if (this.isNotFound) { record.IsNotFound = true; return; } if (record.Width != this.Width || record.Height != this.Height) { record.Width = this.Width; record.Height = this.Height; ImageFileUtility.UpdateInformation(record, true, true); } }
public async Task <bool> LoadImageAsync (Record file, Size?frameSize, bool asThumbnail, bool isFill, bool cmsEnable) { if (file == null) { return(false); } var result = await this.LoadImageMainAsync (file.FullPath, frameSize, asThumbnail, isFill, cmsEnable); if (result && this.Information != null) { if ((file.Width != this.Information.GraphicSize.Width) || (file.Height != this.Information.GraphicSize.Height) || (file.Size != this.Information.FileSize)) { if (this.Information.GraphicSize.Height > 0) { file.Width = this.Information.GraphicSize.Width; } if (this.Information.GraphicSize.Height > 0) { file.Height = this.Information.GraphicSize.Height; } if (this.Information.FileSize > 0) { file.Size = this.Information.FileSize; } ImageFileUtility.UpdateInformation(file, false, true); } } if (this.IsNotFound) { file.IsNotFound = true; Debug.WriteLine($"notfound:{file.Id}"); } return(result); }