Skip to content

Commit

Permalink
Attempt to fix the issue of unable to open images
Browse files Browse the repository at this point in the history
  • Loading branch information
hbl917070 committed May 13, 2024
1 parent 346df60 commit 9831bce
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Tiefsee/Lib/ImgLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,16 @@ public static string VipsResize(string path, double scale, string fileType, stri
kernel = Enums.Kernel.Nearest;
gap = null;
}
using NetVips.Image imR = im.Resize(scale: scale, kernel: kernel, gap: gap);
VipsSave(imR, filePath, "auto");
try {
using NetVips.Image imR = im.Resize(scale: scale, kernel: kernel, gap: gap);
VipsSave(imR, filePath, "auto");
}
catch {
kernel = Enums.Kernel.Nearest;
gap = null;
using NetVips.Image imR = im.Resize(scale: scale, kernel: kernel, gap: gap);
VipsSave(imR, filePath, "auto");
}

StartWindow.isRunGC = true; // 定時執行GC

Expand Down

0 comments on commit 9831bce

Please sign in to comment.