one weird behaviour I'm seeing is that, on pretty much every startup, I'm getting below error, but everything works if I just click Reload. it seems that something broken only during fb2k startup, but not after fb2k had started
Error: Spider Monkey Panel v1.4.1 (Thumbs: Thumbs by marc2003)
Resize failed:
Failed to create GdiPlus object (0x2): InvalidParameter
File: thumbs.js
Line: 540, Column: 122
Stack trace:
iter_image_load_resize@thumbs.js:540:122
c@lodash.min.js:6:348
tu@lodash.min.js:67:168
_thumbs/this.update@thumbs.js:544:25
_thumbs/this.metadb_changed@thumbs.js:171:14
on_metadb_changed@<main>:25:9
_panel/this.item_focus_change@panel.js:11:4
@<main>:12:7
Something similar happened to me on startup because I adjusted fontsize according to window size and gdi font size was 0 at that point. It obviously worked right after startup when I reloaded the panel because window size was != 0. I reported it here some weeks ago.
Check you are not doing the same with gdi image at some point, since it always crashes as soon as width or height is zero, which may happen at startup if you are setting them according to window size.
It may well draw nothing in both cases but...
I think I hit your described issue where SMP is telling me Win size of 0, but in a different way. looks like size of 1 is not valid for resize... SMP doc also doesn't say what's the min size for resize
my code already handles Win size of 0 when I hit this crash. I added some console logging to see what's going on
let w_height = Math.max(window.Height,1), w_width = Math.max(window.Width,1);
let gbmp = _img(image_path);
if(!gbmp) {
console.log("Image load Failed=" + image_path ); // SUPERCOOLMAN
//console.log("Image utils.IsFile=" + utils.IsFile(image_path) ); // SUPERCOOLMAN
//console.log("Image _isFile=" + _isFile(image_path) ); // SUPERCOOLMAN
return;
} // end if
let bmp_height = Math.max(gbmp.Height,1), bmp_width = Math.max(gbmp.Width,1);
let height_ratio = Math.ceil(bmp_height/w_height),width_ratio = Math.ceil(bmp_width/w_width);
console.log(`Image load Failed Win.width=${w_width}\tWin.height=${w_height}`); // SUPERCOOLMAN
console.log(`Image load Failed BMP.width=${bmp_width}\tBMP.height=${bmp_height}`); // SUPERCOOLMAN
console.log(`Image load Failed width_ratio=${width_ratio}\theight_ratio=${height_ratio}`); // SUPERCOOLMAN
console.log(`Image load Failed resized width=${Math.ceil(bmp_width/height_ratio)}\theight=${Math.ceil(bmp_height/height_ratio)}`); // SUPERCOOLMAN
console.log(`Image load Failed resized width=${Math.ceil(bmp_width/width_ratio)}\theight=${Math.ceil(bmp_height/width_ratio)}`); // SUPERCOOLMAN
return (height_ratio >= width_ratio) ? gbmp.Resize(Math.ceil(bmp_width/height_ratio),Math.ceil(bmp_height/height_ratio),0x1): gbmp.Resize(bmp_width/width_ratio,bmp_height/width_ratio,0x1);
result when crashed
Image load Failed Win.width=1 Win.height=1
Image load Failed BMP.width=7596 BMP.height=3767
Image load Failed width_ratio=7596 height_ratio=3767
Image load Failed resized width=3 height=1
Image load Failed resized width=1 height=1
foo_spider_monkey_panel:
Error: Spider Monkey Panel v1.4.1 (Thumbs: Thumbs by marc2003)
Resize failed:
Failed to create GdiPlus object (0x2): InvalidParameter
File: thumbs.js
Line: 545, Column: 144
Stack trace:
iter_image_load_resize@thumbs.js:545:144
c@lodash.min.js:6:348
tu@lodash.min.js:67:168
_thumbs/this.update@thumbs.js:549:25
_thumbs/this.metadb_changed@thumbs.js:171:14
on_metadb_changed@<main>:25:9
_panel/this.item_focus_change@panel.js:11:4
@<main>:12:7