Fix bug where book with corrupt image cannot be queued.

This commit is contained in:
MBucari 2023-03-11 20:40:02 -07:00
parent 245e55782e
commit 5ec01913d5
11 changed files with 58 additions and 67 deletions

View file

@ -19,15 +19,7 @@ namespace LibationWinForms.GridView
public void SetCoverArt(byte[] cover)
{
try
{
pictureBox1.Image = Dinah.Core.WindowsDesktop.Drawing.ImageReader.ToImage(cover);
}
catch (Exception ex)
{
Serilog.Log.Logger.Error(ex, "Error loading cover art for {file}", PictureFileName);
pictureBox1.Image = Properties.Resources.default_cover_500x500;
}
pictureBox1.Image = WinFormsUtil.TryLoadImageOrDefault(cover);
}
#region Make the form's aspect ratio always match the picture's aspect ratio.