Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __TESTS__/unit/fromJson/adjust.fromJson.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('adjust.fromJson', () => {
it('should generate a url with adjust actions from array of models', function () {
const transformation = fromJson([
{ actionType: 'improve', mode: 'outdoor', blend: 30},
{ actionType: 'unsharpMask', level: 50},
{ actionType: 'unsharpMask', strength: 50},
{ actionType: 'saturation', level: 40}
]);

Expand Down
5 changes: 3 additions & 2 deletions src/actions/effect/EffectActions/SimpleEffectAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ class SimpleEffectAction extends Action {
}

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

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

return result;
}
Expand Down