Skip to content

Commit 4e68fa9

Browse files
author
Bastien Eichenberger
committed
bug fix
1 parent 7adf281 commit 4e68fa9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/photoshop/document/resize.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*/
88
PS.Document.Resize = (function (my) {
99

10-
10+
1111
/**
1212
* Function to resize an image in Photoshop
1313
* @function resampling
1414
* @memberOf PS.Document.Resize
1515
* @param {Object} options
1616
* @param {number} options.resolution, the resolution in pixcel per inch
17-
* @param {ResampleMethod} options.resample_method [ResampleMethod.BICUBIC, ResampleMethod.BICUBICSHARPER,
17+
* @param {String} options.resample_method [ResampleMethod.BICUBIC, ResampleMethod.BICUBICSHARPER,
1818
* ResampleMethod.BICUBICSMOOTHER,ResampleMethod.BILINEAR, ResampleMethod.NEARESTNEIGHBOR, ResampleMethod.NONE]
1919
* @param {number} options.horizontal_scale
2020
* @param {number} options.vertical_scale
@@ -29,12 +29,15 @@ PS.Document.Resize = (function (my) {
2929
*/
3030
my.resampling = function (options, document) {
3131

32-
var width, height;
32+
var width, height, options;
33+
34+
// transtype the resample method string to an object ResampleMethod.MyMethod
35+
options.resample_method = eval(options.resample_method);
3336

3437
if (document === undefined) {
3538
var document = app.activeDocument;
3639
}
37-
40+
3841
if (options.resample_method !== ResampleMethod.NONE) {
3942

4043
if (!options.horizontal_scale || !options.vertical_scale) {

tests/package.json

100755100644
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
"test": "grunt test"
2929
},
3030
"devDependencies": {
31-
"xmldoc": "git+https://github.com/nfarina/xmldoc.git",
32-
"grunt-contrib-jshint": "~0.1.1",
31+
"grunt": "~0.4.0",
3332
"grunt-contrib-clean": "~0.4.0",
34-
"grunt-contrib-nodeunit": "~0.1.2",
35-
"grunt": "~0.4.0"
33+
"grunt-contrib-jshint": "~0.1.1",
34+
"grunt-contrib-nodeunit": "0.4.1",
35+
"xmldoc": "git+https://github.com/nfarina/xmldoc.git"
3636
},
3737
"peerDependencies": {
3838
"grunt": "~0.4.0"

0 commit comments

Comments
 (0)