Skip to content

Commit 4b9c248

Browse files
authored
fix unsharpMask strength fromJson (#493)
1 parent c23562e commit 4b9c248

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

__TESTS__/unit/fromJson/adjust.fromJson.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('adjust.fromJson', () => {
44
it('should generate a url with adjust actions from array of models', function () {
55
const transformation = fromJson([
66
{ actionType: 'improve', mode: 'outdoor', blend: 30},
7-
{ actionType: 'unsharpMask', level: 50},
7+
{ actionType: 'unsharpMask', strength: 50},
88
{ actionType: 'saturation', level: 40}
99
]);
1010

src/actions/effect/EffectActions/SimpleEffectAction.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ class SimpleEffectAction extends Action {
3333
}
3434

3535
static fromJson(actionModel: IActionModel): SimpleEffectAction {
36-
const {actionType, level} = (actionModel as IEffectActionWithLevelModel);
36+
const {actionType, level, strength} = (actionModel as IEffectActionWithLevelModel);
3737
const effectType = ACTION_TYPE_TO_EFFECT_MODE_MAP[actionType] || actionType;
3838

3939
// We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel])
4040
// This allows the inheriting classes to determine the class to be created
41-
const result = new this(effectType, level);
41+
// @ts-ignore
42+
const result = new this(effectType, level ? level : strength);
4243

4344
return result;
4445
}

0 commit comments

Comments
 (0)