mahnunchik / gulp-responsive

gulp-responsive generates images at different sizes
https://npmjs.com/gulp-responsive
MIT License
502 stars 62 forks source link

Support for sharp.overlayWith #115

Open larc63 opened 5 years ago

larc63 commented 5 years ago

Can support for sharp.overlayWith be added?

As a proof of concept I added if(config.watermark !== false){ image.overlayWith('admin/wm.png', { gravity: sharp.gravity.southeast } ); } to lib/sharp.js

So, at least the current sharp version already supports this api. "All that's needed" is to wire up an appropriate API from gulp-responsive to call this function. I can think of an easy way with {overlayFile, gravity} or additionally/optionally, calculating the position in pixels by passing in a percentage for width and height.

I'd be happy to give this a go if you'd be ok with some hand-holding with the git process (I've never used git in a formal team before).