sharp icon indicating copy to clipboard operation
sharp copied to clipboard

Set point of rotation. Transform-origin css

Open Alexufo opened this issue 5 years ago • 3 comments

It will be great to implement https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin

Alexufo avatar Oct 01 '19 15:10 Alexufo

This should be possible via the idx, idy, odx, and ody parameters of the internal call to vips_rotate.

These would need exposing in sharp's rotate operation.

lovell avatar Oct 02 '19 14:10 lovell

It shoud works like .rotate(35, {background: '#f2dcd8', idx:100,idy:50,odx:40,ody:50 })?

Alexufo avatar Oct 03 '19 15:10 Alexufo

This would be very useful. The current rotate behavior results in a reference point that is hard to use for subsequent crop operations (e.g. generating a round user avatar image that gets rotated by an angle that is not a multiple of 90°).

jan-tee avatar Jan 17 '20 21:01 jan-tee