You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version passes a string (and it works without typing (ie using any)), but CloudinaryImage.effect only takes EffectActions. I couldn't figure out how it still worked until I got here.
Cloudinary.effect() is basically passed straight through to Transformation.effect here:
throw'addAction cannot accept a string with a forward slash in it - /, use .addTransformation() instead';
}else{
actionToAdd=newRawAction(action);
}
}else{
actionToAdd=action;
}
this.actions.push(actionToAdd);
returnthis;
}
The original call worked with a string because addAction takes a string or an Action, which seems really good. Many Cloudinary users I expect are used to thinking about string values for these things, or at least would expect that to work (ie img.effect('e_tint:40:253f8c)alongsideimg.effect(Adjust.tint('40:253f8c'))`.
Proposed solution:
Update all of the methods for Transformation that pass their parameters along to addAction to accept a string as well as their assigned transform type.
The text was updated successfully, but these errors were encountered:
I'm working on an issue (cloudinary-community/cloudinary-util#53) that makes use of
CloudinaryImage.effect()
The current version passes a string (and it works without typing (ie using
any
)), butCloudinaryImage.effect
only takesEffectActions
. I couldn't figure out how it still worked until I got here.Cloudinary.effect()
is basically passed straight through to Transformation.effect here:js-transformation-builder-sdk/src/transformation/Transformation.ts
Lines 203 to 205 in 61a3606
Which in turn is passed straight to
Transformation.addAction
.js-transformation-builder-sdk/src/transformation/Transformation.ts
Lines 48 to 61 in 61a3606
The original call worked with a string because
addAction
takes a string or anAction
, which seems really good. Many Cloudinary users I expect are used to thinking about string values for these things, or at least would expect that to work (ieimg.effect('e_tint:40:253f8c
)alongside
img.effect(Adjust.tint('40:253f8c'))`.Proposed solution:
Update all of the methods for
Transformation
that pass their parameters along toaddAction
to accept a string as well as their assigned transform type.The text was updated successfully, but these errors were encountered: