mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Allow to provide any positive or negative multiple of 90 to `.rotate(...)`. Negative angles and angles above 360 are converted to valid 0/90/180/270 rotations (0 rotations are still ignored). Changes: - [Node] Add `useExifOrientation` internal variable to know if the Exif orientation must be used instead of the provided angle. This allows to save a negative angle in the `angle` option, because the `-1` special case is not needed. - [Node] Change check for planed-rotation in extract, to prepare a rotation before extraction: check with both `angle` and `useExifOrientation` options. I think this check contains a bit too much logics on rotation options. Maybe we could move this condition to a dedicated function. - [C++] Separate `CalculateRotationAndFlip` into two generic functions: - `CalculateExifRotationAndFlip`: Calculate the angle of rotation and need-to-flip for the given Exif orientation. - `CalculateAngleRotation`: Calculate the rotation for the given angle. One or the other function is used to calculate the rotation, depending on wether the Exif orientation tag or the provided angle must be used. - Add unit tests for `-3690`, `-450`, `-90`, `90`, `450`, `3690` and `-3780`, `-540`, `0`, `180`, `540`, `3780` rotations - Add `320x240` fixture image for tests. Unrelated changes (squashed): - Add ncoden to the list of contributors
79 KiB
79 KiB
