diff --git a/docs/api-operation.md b/docs/api-operation.md index d1c9dd04..86b76528 100644 --- a/docs/api-operation.md +++ b/docs/api-operation.md @@ -24,7 +24,10 @@ Rotate the output image by either an explicit angle or auto-orient based on the EXIF `Orientation` tag. -Use this method without angle to determine the angle from EXIF data. +If an angle is provided, it is converted to a valid 90/180/270deg rotation. +For example, `-450` will produce a 270deg rotation. + +If no angle is provided, it is determined from the EXIF data. Mirroring is supported and may infer the use of a flip operation. The use of `rotate` implies the removal of the EXIF `Orientation` tag, if any. @@ -34,7 +37,7 @@ for example `rotate(x).extract(y)` will produce a different result to `extract(y **Parameters** -- `angle` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** 0, 90, 180 or 270. (optional, default `auto`) +- `angle` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** angle of rotation, must be a multiple of 90. (optional, default `auto`) **Examples** diff --git a/docs/changelog.md b/docs/changelog.md index 12ed2d64..ccc6e34a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -49,6 +49,14 @@ Requires libvips v8.5.5. [#783](https://github.com/lovell/sharp/pull/783) [@YvesBos](https://github.com/YvesBos) +* Add support for rotation using any multiple of +/-90 degrees. + [#791](https://github.com/lovell/sharp/pull/791) + [@ncoden](https://github.com/ncoden) + +* Add "jpg" alias to toFormat as shortened form of "jpeg". + [#814](https://github.com/lovell/sharp/pull/814) + [@jingsam](https://github.com/jingsam) + ### v0.17 - "*quill*" Requires libvips v8.4.2. diff --git a/lib/operation.js b/lib/operation.js index c0b19539..692b68eb 100644 --- a/lib/operation.js +++ b/lib/operation.js @@ -9,7 +9,7 @@ const is = require('./is'); * If an angle is provided, it is converted to a valid 90/180/270deg rotation. * For example, `-450` will produce a 270deg rotation. * - * If no angle is provided, it is determined the from EXIF data. + * If no angle is provided, it is determined from the EXIF data. * Mirroring is supported and may infer the use of a flip operation. * * The use of `rotate` implies the removal of the EXIF `Orientation` tag, if any. diff --git a/package.json b/package.json index a984a89e..ceafeb65 100644 --- a/package.json +++ b/package.json @@ -75,14 +75,14 @@ "tar": "^3.1.3" }, "devDependencies": { - "async": "^2.4.0", - "cc": "^1.0.0", + "async": "^2.4.1", + "cc": "^1.0.1", "documentation": "^4.0.0-rc.1", "exif-reader": "^1.0.2", "icc": "^1.0.0", "mocha": "^3.4.1", "nyc": "^10.3.2", - "rimraf": "^2.5.4", + "rimraf": "^2.6.1", "semistandard": "^11.0.0", "unzip": "^0.1.11" },