diff --git a/lib/appdmg.js b/lib/appdmg.js index 2c4cc60..3ee0bd2 100644 --- a/lib/appdmg.js +++ b/lib/appdmg.js @@ -279,10 +279,14 @@ module.exports = exports = function (options) { **/ pipeline.addStep('Reading background dimensions', function (next) { - if (!global.opts.background) return next.skip() + if (!global.opts.background || (global.opts.window && global.opts.window.size)) return next.skip() sizeOf(resolvePath(global.opts.background), function (err, value) { - if (err) return next(err) + if (err) { + const err2 = new Error(`Could not read dimensions of background image: ${err.name}: ${err.message}\nTo avoid this, give an explicit window size (window.size property) in your dmg specification file.`) + err2.stack = `${err2.stack}\nCaused by: ${err.stack}` + return next(err2) + } global.bkgsize = [value.width, value.height] next(null)