Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

[FEATURE] Adds rotate function #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ Image.prototype.pad = function(options) {
return _wrap(self, padded, options);
}

Image.prototype.rotate = function(color, degree, options) {
const self = this;
const rotated = self._image.rotate(color, degree);
return _wrap(self, rotated, options);
}

Image.prototype.autoOrient = function(options) {
const self = this;
const autoOriented = self._image.autoOrient();
return _wrap(self, autoOriented, options);
}

var _wrap = (self, gm, options) => {
return new Promise(
(resolve, reject) => {
Expand Down