Skip to content
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(config): accept callback function for method arguments #74

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

andrenanninga
Copy link
Contributor

For resizing images a certain percentage I needed access to the metadata of the image. In these changes I added the functionality to use a callback function as args for a method. This function is supplied with the metadata of an image and should return an array.

Example:

{
  method: [
    {
      name: 'resize',
      args: (metadata) => ([
        Math.round(metadata.width * 0.5),
        Math.round(metadata.height * 0.5)
      ])
    }
  ]
}

@axe312ger axe312ger merged commit 5309d38 into axe312ger:master Jun 11, 2018
@axe312ger
Copy link
Owner

Looks good, thank you very much for your contribution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants