diff --git a/lib/widget.js b/lib/widget.js index f213c65..d0223ab 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -6583,7 +6583,7 @@ Image.w3mdisplay = '/usr/lib/w3m/w3mimgdisplay'; Image.prototype.render = function() { var ret = this._render(); if (!ret) return; - this.setImage(this.options.file); + this.setImage(this.img); return ret; }; diff --git a/test/widget-image.js b/test/widget-image.js index 01af414..68a58d4 100644 --- a/test/widget-image.js +++ b/test/widget-image.js @@ -6,16 +6,24 @@ screen = blessed.screen({ smartCSR: true }); +blessed.image.w3mdisplay = '/does/not/exist'; + +var file = process.argv[2] || __dirname + '/test-image.png'; + var img = blessed.image({ parent: screen, left: 'center', top: 'center', width: 'shrink', height: 'shrink', - bg: 'green', - file: process.argv[2] || __dirname + '/test-image.png' + bg: 'green' }); +setTimeout(function() { + img.setImage(file); + screen.render(); +}, 1000); + img.focus(); screen.key('i', function() {