Thanks for the additional info, I can reproduce it now.
As you figured it out, it is indeed the disc art rotation images '180 (2 degrees)' when in 4K mode.
This eats a LOT of ram on such high disc art image resolution, especially on 2 degrees.
It seems with foobar 32-bit ( can handle only max 4 gigs ) it fills and reaches its limit and then crashes.
I've done some test and for me it crashes when using 1600x1600px res:
function RotateImg(img, w, h, degrees) {
w = 1600;
h = 1600;
console.log(`Img: ${img}, Width: ${w}, Height: ${h}`);
if (degrees !== 0) {
/** @type {GdiBitmap} */
const rotatedImg = gdi.CreateImage(w, h);
const gotGraphics = rotatedImg.GetGraphics();
gotGraphics.DrawImage(img, 0, 0, w, h, 0, 0, img.Width, img.Height, degrees);
rotatedImg.ReleaseGraphics(gotGraphics);
return rotatedImg;
}
return img.Clone(0, 0, img.Width, img.Height).Resize(w, h);
}
when changing to 1500x1500px it is OK with the 2 degrees rotation.
Can you confirm this yourself? Just copy and paste the code above and replace it in the same helper function
where you previously pasted the console.log. The rotation creates images from the disc art and fills the memory until it has spun 360°
for the very first time. Then the rotation performance is much better because it reads those images directly from memory.
If confirmed, try the proper fix with a set max resolution:
function RotateImg(img, w, h, degrees) {
const maxImgRes = 1500;
w = Math.min(w, maxImgRes);
h = Math.min(h, maxImgRes);
if (degrees !== 0) {
/** @type {GdiBitmap} */
const rotatedImg = gdi.CreateImage(w, h);
const gotGraphics = rotatedImg.GetGraphics();
gotGraphics.DrawImage(img, 0, 0, w, h, 0, 0, img.Width, img.Height, degrees);
rotatedImg.ReleaseGraphics(gotGraphics);
return rotatedImg;
}
return img.Clone(0, 0, img.Width, img.Height).Resize(w, h);
}
Thanks!
-Tom