-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(image-sharp): add trim option #14137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is much value to split the argument into a boolean and a float, it'd be pretty easy for the user to pass trim default value as an argument, so there is no need to complicate the API further.
@freiksenet I made the requested changes, but squashed the prior commits before pushing the new changes which may have interrupted the normal review workflow. Do I need to do make any other changes? |
* feat(sharp): add trim option * fix: trim option only as number
Description
Add the @lovell/sharp
trim
option (and standardizefit
&background
fromfluid
tofixed
).I was trying different sharp options with a list of video screenshots (currently using
fixed()
), some of which have black bars, and saw that sharp offered a trim option.Further, the
fit
andbackground
settings weren't available onfixed
.Note: My original plan was to have it accept either a
boolean
orint
, withtrue
representing thesharp
default threshold. (currently10
)Unfortunately, per graphql/graphql-spec#488, GraphQL doesn't accept union types as inputs currently.
GraphQLInt
coalesces true to 1 and false to 0 (0 is an invalid threshold value, so it's still OK to use to disable the setting)Related Issues