Closed Echobob closed 6 years ago
When trying to use this feature, I get an error saying:
Expected options.clip.x to be a number but found undefined
I resolved this by adding the following to core/image-core.js at line 27 ( before logOpts
)
if(_.isEmpty(_.pickBy(opts.image.clip))){
opts.image.clip = undefined
}
This will set the clip value to undefined if none of the clipping options have been set. The error will still occur if some but not all of the clipping options are set but I think that should be the client's responsibility
This feature is good but the PR is adding a bit too much duplicate code to maintain plus it would be a API breaking change as is. I don't have time to thoroughly think about this through but it would need some refactoring before merge.
This feature has now been implemented into master. The implementation maintains API backwards compability.
Not sure if anyone would want this, but I've added support for puppeteer's screenshotting method. This would change the
api/render
toapi/pdf/render
&api/image/render
(TODO: Docs & Tests)