Skip to content

Commit

Permalink
Merge pull request #242 from adobe-photoshop/jrb/scaling-option
Browse files Browse the repository at this point in the history
add config parameter use-psd-smart-object-pixel-scaling
  • Loading branch information
iwehrman committed Jul 1, 2014
2 parents 9bd919c + 02885fe commit acc4237
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
if (config.hasOwnProperty("allow-dither")) {
this._allowDither = !!config["allow-dither"];
}

if (config.hasOwnProperty("use-psd-smart-object-pixel-scaling")) {
this._forceSmartPSDPixelScaling = !!config["use-psd-smart-object-pixel-scaling"];
}
}

/**
Expand All @@ -83,6 +87,11 @@
*/
BaseRenderer.prototype._allowDither = undefined;

/**
* @type {boolean=}
*/
BaseRenderer.prototype._forceSmartPSDPixelScaling = undefined;

/**
* Convert a value in a given unit, at particular resolution, to a value in pixels per inch.
*
Expand Down Expand Up @@ -342,6 +351,10 @@
pixmapSettings.interpolationType = this._interpolationType;
}

if (this._forceSmartPSDPixelScaling !== undefined) {
pixmapSettings.forceSmartPSDPixelScaling = this._forceSmartPSDPixelScaling;
}

return this._generator.getPixmap(this._document.id, layer.id, pixmapSettings).then(function (pixmap) {
var padding = pixmapSettings.hasOwnProperty("getPadding") ?
pixmapSettings.getPadding(pixmap.width, pixmap.height) : undefined,
Expand Down

0 comments on commit acc4237

Please sign in to comment.