Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jimp/plugin-rotate

Package Overview
Dependencies
Maintainers
2
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/plugin-rotate - npm Package Compare versions

Comparing version 0.16.3-canary.1125.1580.0 to 0.16.3

16

CHANGELOG.md

@@ -0,1 +1,13 @@

# v0.16.3 (Sat Feb 04 2023)
#### ⚠️ Pushed to `master`
- upgrade prettier ([@hipstersmoothie](https://github.com/hipstersmoothie))
#### Authors: 1
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
---
# v0.11.0 (Fri May 15 2020)

@@ -15,3 +27,3 @@

#### 🐛 Bug Fix
#### 🐛 Bug Fix

@@ -24,2 +36,2 @@ - `@jimp/cli`, `@jimp/core`, `@jimp/custom`, `jimp`, `@jimp/plugin-blit`, `@jimp/plugin-blur`, `@jimp/plugin-circle`, `@jimp/plugin-color`, `@jimp/plugin-contain`, `@jimp/plugin-cover`, `@jimp/plugin-crop`, `@jimp/plugin-displace`, `@jimp/plugin-dither`, `@jimp/plugin-fisheye`, `@jimp/plugin-flip`, `@jimp/plugin-gaussian`, `@jimp/plugin-invert`, `@jimp/plugin-mask`, `@jimp/plugin-normalize`, `@jimp/plugin-print`, `@jimp/plugin-resize`, `@jimp/plugin-rotate`, `@jimp/plugin-scale`, `@jimp/plugin-shadow`, `@jimp/plugin-threshold`, `@jimp/plugins`, `@jimp/test-utils`, `@jimp/bmp`, `@jimp/gif`, `@jimp/jpeg`, `@jimp/png`, `@jimp/tiff`, `@jimp/types`, `@jimp/utils`

- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn))
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn))

16

dist/index.js

@@ -24,3 +24,3 @@ "use strict";

if (mode === true || typeof mode === 'string') {
if (mode === true || typeof mode === "string") {
// resize the image to it maximum dimension and blit the existing image

@@ -85,3 +85,3 @@ // onto the center so that when it is rotated the image is kept in bounds

if (mode === true || typeof mode === 'string') {
if (mode === true || typeof mode === "string") {
// now crop the image to the final size

@@ -107,3 +107,3 @@ var _x = bW / 2 - w / 2;

// enable overloading
if (typeof mode === 'undefined' || mode === null) {
if (typeof mode === "undefined" || mode === null) {
// e.g. image.resize(120);

@@ -115,3 +115,3 @@ // e.g. image.resize(120, null, cb);

if (typeof mode === 'function' && typeof cb === 'undefined') {
if (typeof mode === "function" && typeof cb === "undefined") {
// e.g. image.resize(120, cb);

@@ -122,8 +122,8 @@ cb = mode;

if (typeof deg !== 'number') {
return _utils.throwError.call(this, 'deg must be a number', cb);
if (typeof deg !== "number") {
return _utils.throwError.call(this, "deg must be a number", cb);
}
if (typeof mode !== 'boolean' && typeof mode !== 'string') {
return _utils.throwError.call(this, 'mode must be a boolean or a string', cb);
if (typeof mode !== "boolean" && typeof mode !== "string") {
return _utils.throwError.call(this, "mode must be a boolean or a string", cb);
}

@@ -130,0 +130,0 @@

@@ -1,2 +0,2 @@

import { ImageCallback } from '@jimp/core';
import { ImageCallback } from "@jimp/core";

@@ -8,2 +8,2 @@ interface Rotate {

export default function(): Rotate;
export default function (): Rotate;
{
"name": "@jimp/plugin-rotate",
"version": "0.16.3-canary.1125.1580.0",
"version": "0.16.3",
"description": "Rotate an image.",

@@ -24,3 +24,3 @@ "main": "dist/index.js",

"@babel/runtime": "^7.7.2",
"@jimp/utils": "0.16.3-canary.1125.1580.0"
"@jimp/utils": "^0.16.3"
},

@@ -34,7 +34,7 @@ "peerDependencies": {

"devDependencies": {
"@jimp/custom": "0.16.3-canary.1125.1580.0",
"@jimp/plugin-blit": "0.16.3-canary.1125.1580.0",
"@jimp/plugin-crop": "0.16.3-canary.1125.1580.0",
"@jimp/plugin-resize": "0.16.3-canary.1125.1580.0",
"@jimp/test-utils": "0.16.3-canary.1125.1580.0"
"@jimp/custom": "^0.16.3",
"@jimp/plugin-blit": "^0.16.3",
"@jimp/plugin-crop": "^0.16.3",
"@jimp/plugin-resize": "^0.16.3",
"@jimp/test-utils": "^0.16.3"
},

@@ -44,3 +44,3 @@ "publishConfig": {

},
"gitHead": "bfdb98aaf820272c06e332483b943d0ac58659db"
"gitHead": "b9ac83d855d09deecde129a9c9b5b328ba7ea5b2"
}

@@ -17,6 +17,6 @@ <div align="center">

```js
import jimp from 'jimp';
import jimp from "jimp";
async function main() {
const image = await jimp.read('test/image.png');
const image = await jimp.read("test/image.png");

@@ -23,0 +23,0 @@ image.rotate(90);

@@ -1,2 +0,2 @@

import { throwError, isNodePattern } from '@jimp/utils';
import { throwError, isNodePattern } from "@jimp/utils";

@@ -18,3 +18,3 @@ /**

if (mode === true || typeof mode === 'string') {
if (mode === true || typeof mode === "string") {
// resize the image to it maximum dimension and blit the existing image

@@ -45,9 +45,11 @@ // onto the center so that when it is rotated the image is kept in bounds

const c = this.cloneQuiet();
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function(
x,
y,
idx
) {
this.bitmap.data.writeUInt32BE(this._background, idx);
});
this.scanQuiet(
0,
0,
this.bitmap.width,
this.bitmap.height,
function (x, y, idx) {
this.bitmap.data.writeUInt32BE(this._background, idx);
}
);

@@ -69,6 +71,6 @@ const max = Math.max(w, h, this.bitmap.width, this.bitmap.height);

function createTranslationFunction(deltaX, deltaY) {
return function(x, y) {
return function (x, y) {
return {
x: x + deltaX,
y: y + deltaY
y: y + deltaY,
};

@@ -106,3 +108,3 @@ };

if (mode === true || typeof mode === 'string') {
if (mode === true || typeof mode === "string") {
// now crop the image to the final size

@@ -125,3 +127,3 @@ const x = bW / 2 - w / 2;

// enable overloading
if (typeof mode === 'undefined' || mode === null) {
if (typeof mode === "undefined" || mode === null) {
// e.g. image.resize(120);

@@ -133,3 +135,3 @@ // e.g. image.resize(120, null, cb);

if (typeof mode === 'function' && typeof cb === 'undefined') {
if (typeof mode === "function" && typeof cb === "undefined") {
// e.g. image.resize(120, cb);

@@ -140,8 +142,8 @@ cb = mode;

if (typeof deg !== 'number') {
return throwError.call(this, 'deg must be a number', cb);
if (typeof deg !== "number") {
return throwError.call(this, "deg must be a number", cb);
}
if (typeof mode !== 'boolean' && typeof mode !== 'string') {
return throwError.call(this, 'mode must be a boolean or a string', cb);
if (typeof mode !== "boolean" && typeof mode !== "string") {
return throwError.call(this, "mode must be a boolean or a string", cb);
}

@@ -156,3 +158,3 @@

return this;
}
},
});

@@ -1,29 +0,29 @@

import { Jimp, mkJGD } from '@jimp/test-utils';
import configure from '@jimp/custom';
import blit from '@jimp/plugin-blit';
import crop from '@jimp/plugin-crop';
import resize from '@jimp/plugin-resize';
import { Jimp, mkJGD } from "@jimp/test-utils";
import configure from "@jimp/custom";
import blit from "@jimp/plugin-blit";
import crop from "@jimp/plugin-crop";
import resize from "@jimp/plugin-resize";
import rotate from '../src';
import rotate from "../src";
const jimp = configure({ plugins: [rotate, blit, crop, resize] }, Jimp);
describe('Rotate a image with even size', () => {
describe("Rotate a image with even size", () => {
let imgSrc = null;
before(done => {
before((done) => {
jimp
.read(
mkJGD(
'▰▴▴▴▪▪▪▰',
'▴▴▴▴▪▪▪▪',
'▴▴▴▴▪▪▪▪',
'▴▴▴▴▪▪▪▪',
'▪▪▪▪▴▴▴▴',
'▪▪▪▪▴▴▴▴',
'▪▪▪▪▴▴▴▴',
'▦▪▪▪▴▴▴▦'
"▰▴▴▴▪▪▪▰",
"▴▴▴▴▪▪▪▪",
"▴▴▴▴▪▪▪▪",
"▴▴▴▴▪▪▪▪",
"▪▪▪▪▴▴▴▴",
"▪▪▪▪▴▴▴▴",
"▪▪▪▪▴▴▴▴",
"▦▪▪▪▴▴▴▦"
)
)
.then(imgJimp => {
.then((imgJimp) => {
imgSrc = imgJimp;

@@ -35,3 +35,3 @@ done();

it('1 degrees', () => {
it("1 degrees", () => {
imgSrc

@@ -43,12 +43,12 @@ .clone()

mkJGD(
'▰▴▴▴▪▪▪▰ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▦▪▪▪▴▴▴▦ ',
' ',
' '
"▰▴▴▴▪▪▪▰ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▦▪▪▪▴▴▴▦ ",
" ",
" "
)

@@ -58,3 +58,3 @@ );

it('91 degrees', () => {
it("91 degrees", () => {
imgSrc

@@ -66,12 +66,12 @@ .clone()

mkJGD(
' ',
'▰▪▪▪▴▴▴▦ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▰▴▴▴▪▪▪▦ ',
' '
" ",
"▰▪▪▪▴▴▴▦ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▰▴▴▴▪▪▪▦ ",
" "
)

@@ -81,3 +81,3 @@ );

it('30 degrees', () => {
it("30 degrees", () => {
imgSrc

@@ -89,14 +89,14 @@ .clone()

mkJGD(
' ▰▰ ',
' ▪▪▪▪ ',
' ▴▪▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▴▴▴ ',
'▴▴▴▴▪▴▴▴▴▴ ',
' ▴▴▪▪▴▴▴▴▦ ',
' ▪▪▪▪▪▴▴▴ ',
' ▪▪▪▪▪ ',
' ▪▪▪ ',
' ▦ ',
' '
" ▰▰ ",
" ▪▪▪▪ ",
" ▴▪▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▴▴▴ ",
"▴▴▴▴▪▴▴▴▴▴ ",
" ▴▴▪▪▴▴▴▴▦ ",
" ▪▪▪▪▪▴▴▴ ",
" ▪▪▪▪▪ ",
" ▪▪▪ ",
" ▦ ",
" "
)

@@ -106,3 +106,3 @@ );

it('45 degrees', () => {
it("45 degrees", () => {
imgSrc

@@ -114,16 +114,16 @@ .clone()

mkJGD(
' ',
' ▰ ',
' ▪▪▪ ',
' ▪▪▪▪▪ ',
' ▴▴▪▪▪▪▴ ',
' ▴▴▴▴▪▪▴▴▴ ',
'▰▰▴▴▴▴▴▴▴▴▦ ',
' ▴▴▴▴▪▪▴▴▴ ',
' ▴▴▪▪▪▪▴ ',
' ▪▪▪▪▪ ',
' ▪▪▪ ',
' ▦ ',
' ',
' '
" ",
" ▰ ",
" ▪▪▪ ",
" ▪▪▪▪▪ ",
" ▴▴▪▪▪▪▴ ",
" ▴▴▴▴▪▪▴▴▴ ",
"▰▰▴▴▴▴▴▴▴▴▦ ",
" ▴▴▴▴▪▪▴▴▴ ",
" ▴▴▪▪▪▪▴ ",
" ▪▪▪▪▪ ",
" ▪▪▪ ",
" ▦ ",
" ",
" "
)

@@ -133,3 +133,3 @@ );

it('60 degrees', () => {
it("60 degrees", () => {
imgSrc

@@ -141,14 +141,14 @@ .clone()

mkJGD(
' ▰ ',
' ▪▪▪ ',
' ▪▪▪▪▪ ',
' ▪▪▪▪▪▴▴▴ ',
' ▴▴▪▪▴▴▴▴▦ ',
'▴▴▴▴▪▴▴▴▴▴ ',
'▴▴▴▴▪▪▴▴▴ ',
'▴▴▴▴▪▪▪▪ ',
' ▴▪▪▪▪▪ ',
' ▪▪▪▪ ',
' ▦▦ ',
' '
" ▰ ",
" ▪▪▪ ",
" ▪▪▪▪▪ ",
" ▪▪▪▪▪▴▴▴ ",
" ▴▴▪▪▴▴▴▴▦ ",
"▴▴▴▴▪▴▴▴▴▴ ",
"▴▴▴▴▪▪▴▴▴ ",
"▴▴▴▴▪▪▪▪ ",
" ▴▪▪▪▪▪ ",
" ▪▪▪▪ ",
" ▦▦ ",
" "
)

@@ -158,3 +158,3 @@ );

it('90 degrees', () => {
it("90 degrees", () => {
imgSrc

@@ -166,12 +166,12 @@ .clone()

mkJGD(
' ',
'▰▪▪▪▴▴▴▦ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▰▴▴▴▪▪▪▦ ',
' '
" ",
"▰▪▪▪▴▴▴▦ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▰▴▴▴▪▪▪▦ ",
" "
)

@@ -181,3 +181,3 @@ );

it('120 degrees', () => {
it("120 degrees", () => {
imgSrc

@@ -189,14 +189,14 @@ .clone()

mkJGD(
' ',
' ▴▦ ',
' ▴▴▴▴ ',
' ▪▪▴▴▴▴ ',
'▰▪▪▪▴▴▴▴▪ ',
'▰▪▪▪▪▴▴▪▪▪ ',
' ▪▪▪▪▪▪▪▪▪ ',
' ▪▪▴▴▴▪▪▪▪▦ ',
' ▴▴▴▴▴▪▪ ',
' ▴▴▴▴▪ ',
' ▴▴▴ ',
' '
" ",
" ▴▦ ",
" ▴▴▴▴ ",
" ▪▪▴▴▴▴ ",
"▰▪▪▪▴▴▴▴▪ ",
"▰▪▪▪▪▴▴▪▪▪ ",
" ▪▪▪▪▪▪▪▪▪ ",
" ▪▪▴▴▴▪▪▪▪▦ ",
" ▴▴▴▴▴▪▪ ",
" ▴▴▴▴▪ ",
" ▴▴▴ ",
" "
)

@@ -206,3 +206,3 @@ );

it('135 degrees', () => {
it("135 degrees", () => {
imgSrc

@@ -214,16 +214,16 @@ .clone()

mkJGD(
' ',
' ',
' ▦ ',
' ▴▴▴ ',
' ▴▴▴▴▴ ',
' ▪▪▴▴▴▪▪ ',
' ▪▪▪▪▴▪▪▪▪ ',
' ▰▪▪▪▪▴▪▪▪▪▦ ',
' ▪▪▪▴▴▴▪▪▪ ',
' ▪▴▴▴▴▴▪ ',
' ▴▴▴▴▴ ',
' ▴▰▴ ',
' ▰ ',
' '
" ",
" ",
" ▦ ",
" ▴▴▴ ",
" ▴▴▴▴▴ ",
" ▪▪▴▴▴▪▪ ",
" ▪▪▪▪▴▪▪▪▪ ",
" ▰▪▪▪▪▴▪▪▪▪▦ ",
" ▪▪▪▴▴▴▪▪▪ ",
" ▪▴▴▴▴▴▪ ",
" ▴▴▴▴▴ ",
" ▴▰▴ ",
" ▰ ",
" "
)

@@ -233,3 +233,3 @@ );

it('180 degrees', () => {
it("180 degrees", () => {
imgSrc

@@ -241,12 +241,12 @@ .clone()

mkJGD(
' ',
' ▦▴▴▴▪▪▪▦ ',
' ▴▴▴▴▪▪▪▪ ',
' ▴▴▴▴▪▪▪▪ ',
' ▴▴▴▴▪▪▪▪ ',
' ▪▪▪▪▴▴▴▴ ',
' ▪▪▪▪▴▴▴▴ ',
' ▪▪▪▪▴▴▴▴ ',
' ▰▪▪▪▴▴▴▰ ',
' '
" ",
" ▦▴▴▴▪▪▪▦ ",
" ▴▴▴▴▪▪▪▪ ",
" ▴▴▴▴▪▪▪▪ ",
" ▴▴▴▴▪▪▪▪ ",
" ▪▪▪▪▴▴▴▴ ",
" ▪▪▪▪▴▴▴▴ ",
" ▪▪▪▪▴▴▴▴ ",
" ▰▪▪▪▴▴▴▰ ",
" "
)

@@ -256,3 +256,3 @@ );

it('225 degrees', () => {
it("225 degrees", () => {
imgSrc

@@ -264,16 +264,16 @@ .clone()

mkJGD(
' ',
' ▦ ',
' ▪▪▪ ',
' ▪▪▪▪▪ ',
' ▴▪▪▪▪▴▴ ',
' ▴▴▴▪▪▴▴▴▴ ',
' ▦▴▴▴▴▴▴▴▴▰▰ ',
' ▴▴▴▪▪▴▴▴▴ ',
' ▴▪▪▪▪▴▴ ',
' ▪▪▪▪▪ ',
' ▪▪▪ ',
' ▰ ',
' ',
' '
" ",
" ▦ ",
" ▪▪▪ ",
" ▪▪▪▪▪ ",
" ▴▪▪▪▪▴▴ ",
" ▴▴▴▪▪▴▴▴▴ ",
" ▦▴▴▴▴▴▴▴▴▰▰ ",
" ▴▴▴▪▪▴▴▴▴ ",
" ▴▪▪▪▪▴▴ ",
" ▪▪▪▪▪ ",
" ▪▪▪ ",
" ▰ ",
" ",
" "
)

@@ -283,3 +283,3 @@ );

it('270 degrees', () => {
it("270 degrees", () => {
imgSrc

@@ -291,12 +291,12 @@ .clone()

mkJGD(
' ▦▪▪▪▴▴▴▰ ',
' ▪▪▪▪▴▴▴▴ ',
' ▪▪▪▪▴▴▴▴ ',
' ▪▪▪▪▴▴▴▴ ',
' ▴▴▴▴▪▪▪▪ ',
' ▴▴▴▴▪▪▪▪ ',
' ▴▴▴▴▪▪▪▪ ',
' ▦▴▴▴▪▪▪▰ ',
' ',
' '
" ▦▪▪▪▴▴▴▰ ",
" ▪▪▪▪▴▴▴▴ ",
" ▪▪▪▪▴▴▴▴ ",
" ▪▪▪▪▴▴▴▴ ",
" ▴▴▴▴▪▪▪▪ ",
" ▴▴▴▴▪▪▪▪ ",
" ▴▴▴▴▪▪▪▪ ",
" ▦▴▴▴▪▪▪▰ ",
" ",
" "
)

@@ -306,3 +306,3 @@ );

it('315 degrees', () => {
it("315 degrees", () => {
imgSrc

@@ -314,16 +314,16 @@ .clone()

mkJGD(
' ▰ ',
' ▴▰▴ ',
' ▴▴▴▴▴ ',
' ▪▴▴▴▴▴▪ ',
' ▪▪▪▴▴▴▪▪▪ ',
' ▦▪▪▪▪▴▪▪▪▪▰ ',
' ▪▪▪▪▴▪▪▪▪ ',
' ▪▪▴▴▴▪▪ ',
' ▴▴▴▴▴ ',
' ▴▴▴ ',
' ▦ ',
' ',
' ',
' '
" ▰ ",
" ▴▰▴ ",
" ▴▴▴▴▴ ",
" ▪▴▴▴▴▴▪ ",
" ▪▪▪▴▴▴▪▪▪ ",
" ▦▪▪▪▪▴▪▪▪▪▰ ",
" ▪▪▪▪▴▪▪▪▪ ",
" ▪▪▴▴▴▪▪ ",
" ▴▴▴▴▴ ",
" ▴▴▴ ",
" ▦ ",
" ",
" ",
" "
)

@@ -333,3 +333,3 @@ );

it('360 degrees', () => {
it("360 degrees", () => {
imgSrc

@@ -341,12 +341,12 @@ .clone()

mkJGD(
'▰▴▴▴▪▪▪▰ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▪▪▪▪▴▴▴▴ ',
'▦▪▪▪▴▴▴▦ ',
' ',
' '
"▰▴▴▴▪▪▪▰ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▪▪▪▪▴▴▴▴ ",
"▦▪▪▪▴▴▴▦ ",
" ",
" "
)

@@ -357,18 +357,18 @@ );

describe('Rotate a image with odd size', () => {
describe("Rotate a image with odd size", () => {
let imgSrc = null;
before(done => {
before((done) => {
jimp
.read(
mkJGD(
'▴▴▴▦▪▪▪',
'▴▴▴▦▪▪▪',
'▴▴▴▦▪▪▪',
'▦▦▦▦▦▦▦',
'▴▴▴▦▴▴▴',
'▴▴▴▦▴▴▴',
'▴▴▴▦▴▴▴'
"▴▴▴▦▪▪▪",
"▴▴▴▦▪▪▪",
"▴▴▴▦▪▪▪",
"▦▦▦▦▦▦▦",
"▴▴▴▦▴▴▴",
"▴▴▴▦▴▴▴",
"▴▴▴▦▴▴▴"
)
)
.then(imgJimp => {
.then((imgJimp) => {
imgSrc = imgJimp;

@@ -380,3 +380,3 @@ done();

it('45 degrees', () => {
it("45 degrees", () => {
imgSrc

@@ -388,14 +388,14 @@ .clone()

mkJGD(
' ',
' ▪ ',
' ▪▪▪ ',
' ▦▪▪▪▦ ',
' ▴▴▦▪▦▴▴ ',
' ▴▴▴▴▦▴▴▴▴ ',
' ▴▴▦▴▦▴▴ ',
' ▦▴▴▴▦ ',
' ▴▴▴ ',
' ▴ ',
' ',
' '
" ",
" ▪ ",
" ▪▪▪ ",
" ▦▪▪▪▦ ",
" ▴▴▦▪▦▴▴ ",
" ▴▴▴▴▦▴▴▴▴ ",
" ▴▴▦▴▦▴▴ ",
" ▦▴▴▴▦ ",
" ▴▴▴ ",
" ▴ ",
" ",
" "
)

@@ -405,3 +405,3 @@ );

it('135 degrees', () => {
it("135 degrees", () => {
imgSrc

@@ -413,14 +413,14 @@ .clone()

mkJGD(
' ',
' ▴ ',
' ▴▴▴ ',
' ▦▴▴▴▦ ',
' ▪▪▦▴▦▴▴ ',
' ▪▪▪▪▦▴▴▴▴ ',
' ▪▪▦▴▦▴▴ ',
' ▦▴▴▴▦ ',
' ▴▴▴ ',
' ▴ ',
' ',
' '
" ",
" ▴ ",
" ▴▴▴ ",
" ▦▴▴▴▦ ",
" ▪▪▦▴▦▴▴ ",
" ▪▪▪▪▦▴▴▴▴ ",
" ▪▪▦▴▦▴▴ ",
" ▦▴▴▴▦ ",
" ▴▴▴ ",
" ▴ ",
" ",
" "
)

@@ -430,3 +430,3 @@ );

it('225 degrees', () => {
it("225 degrees", () => {
imgSrc

@@ -438,14 +438,14 @@ .clone()

mkJGD(
' ',
' ▴ ',
' ▴▴▴ ',
' ▦▴▴▴▦ ',
' ▴▴▦▴▦▴▴ ',
' ▴▴▴▴▦▴▴▴▴ ',
' ▴▴▦▪▦▴▴ ',
' ▦▪▪▪▦ ',
' ▪▪▪ ',
' ▪ ',
' ',
' '
" ",
" ▴ ",
" ▴▴▴ ",
" ▦▴▴▴▦ ",
" ▴▴▦▴▦▴▴ ",
" ▴▴▴▴▦▴▴▴▴ ",
" ▴▴▦▪▦▴▴ ",
" ▦▪▪▪▦ ",
" ▪▪▪ ",
" ▪ ",
" ",
" "
)

@@ -455,3 +455,3 @@ );

it('315 degrees', () => {
it("315 degrees", () => {
imgSrc

@@ -463,14 +463,14 @@ .clone()

mkJGD(
' ',
' ▴ ',
' ▴▴▴ ',
' ▦▴▴▴▦ ',
' ▴▴▦▴▦▪▪ ',
' ▴▴▴▴▦▪▪▪▪ ',
' ▴▴▦▴▦▪▪ ',
' ▦▴▴▴▦ ',
' ▴▴▴ ',
' ▴ ',
' ',
' '
" ",
" ▴ ",
" ▴▴▴ ",
" ▦▴▴▴▦ ",
" ▴▴▦▴▦▪▪ ",
" ▴▴▴▴▦▪▪▪▪ ",
" ▴▴▦▴▦▪▪ ",
" ▦▴▴▴▦ ",
" ▴▴▴ ",
" ▴ ",
" ",
" "
)

@@ -481,8 +481,8 @@ );

describe('Rotate a non-square image', () => {
describe("Rotate a non-square image", () => {
let imgSrc = null;
before(done => {
before((done) => {
jimp
.read(mkJGD('▴▴▴▴▪▪▪▪', '▴▴▴▴▪▪▪▪', '▦▦▦▦▴▴▴▴', '▦▦▦▦▴▴▴▴'))
.then(imgJimp => {
.read(mkJGD("▴▴▴▴▪▪▪▪", "▴▴▴▴▪▪▪▪", "▦▦▦▦▴▴▴▴", "▦▦▦▦▴▴▴▴"))
.then((imgJimp) => {
imgSrc = imgJimp;

@@ -494,3 +494,3 @@ done();

it('1 degrees', () => {
it("1 degrees", () => {
imgSrc

@@ -502,8 +502,8 @@ .clone()

mkJGD(
'▴▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▪ ',
'▦▦▦▦▴▴▴▴ ',
'▦▦▦▦▴▴▴▴ ',
' ',
' '
"▴▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▪ ",
"▦▦▦▦▴▴▴▴ ",
"▦▦▦▦▴▴▴▴ ",
" ",
" "
)

@@ -513,3 +513,3 @@ );

it('10 degrees', () => {
it("10 degrees", () => {
imgSrc

@@ -521,10 +521,10 @@ .clone()

mkJGD(
' ▪ ',
' ▴▴▴▪▪▪▪ ',
'▴▴▴▴▪▪▪▴ ',
'▴▴▦▦▴▴▴▴ ',
'▦▦▦▦▴▴▴ ',
'▦▦ ',
' ',
' '
" ▪ ",
" ▴▴▴▪▪▪▪ ",
"▴▴▴▴▪▪▪▴ ",
"▴▴▦▦▴▴▴▴ ",
"▦▦▦▦▴▴▴ ",
"▦▦ ",
" ",
" "
)

@@ -534,3 +534,3 @@ );

it('30 degrees', () => {
it("30 degrees", () => {
imgSrc

@@ -542,12 +542,12 @@ .clone()

mkJGD(
' ',
' ▪▪ ',
' ▪▪▪▪ ',
' ▴▴▪▪▴▴▴ ',
'▴▴▴▦▴▴▴ ',
'▴▴▦▦▴▴ ',
'▦▦▦▦ ',
' ▦ ',
' ',
' '
" ",
" ▪▪ ",
" ▪▪▪▪ ",
" ▴▴▪▪▴▴▴ ",
"▴▴▴▦▴▴▴ ",
"▴▴▦▦▴▴ ",
"▦▦▦▦ ",
" ▦ ",
" ",
" "
)

@@ -557,3 +557,3 @@ );

it('45 degrees', () => {
it("45 degrees", () => {
imgSrc

@@ -565,12 +565,12 @@ .clone()

mkJGD(
' ',
' ▪▪ ',
' ▪▪▪▴ ',
' ▴▪▪▴▴▴ ',
' ▴▴▴▴▴▴ ',
'▴▴▴▦▦▴ ',
'▴▴▦▦▦ ',
' ▦▦▦ ',
' ▦ ',
' '
" ",
" ▪▪ ",
" ▪▪▪▴ ",
" ▴▪▪▴▴▴ ",
" ▴▴▴▴▴▴ ",
"▴▴▴▦▦▴ ",
"▴▴▦▦▦ ",
" ▦▦▦ ",
" ▦ ",
" "
)

@@ -580,3 +580,3 @@ );

it('90 degrees', () => {
it("90 degrees", () => {
imgSrc

@@ -588,12 +588,12 @@ .clone()

mkJGD(
' ',
'▪▪▴▴ ',
'▪▪▴▴ ',
'▪▪▴▴ ',
'▪▪▴▴ ',
'▴▴▦▦ ',
'▴▴▦▦ ',
'▴▴▦▦ ',
'▴▴▦▦ ',
' '
" ",
"▪▪▴▴ ",
"▪▪▴▴ ",
"▪▪▴▴ ",
"▪▪▴▴ ",
"▴▴▦▦ ",
"▴▴▦▦ ",
"▴▴▦▦ ",
"▴▴▦▦ ",
" "
)

@@ -603,3 +603,3 @@ );

it('135 degrees', () => {
it("135 degrees", () => {
imgSrc

@@ -611,12 +611,12 @@ .clone()

mkJGD(
' ',
' ▴ ',
' ▴▴▴ ',
' ▪▪▴▴▴ ',
' ▪▪▪▴▦▦ ',
' ▪▪▴▦▦▦ ',
' ▴▴▴▦▦▦ ',
' ▴▴▴▦ ',
' ▴▴ ',
' '
" ",
" ▴ ",
" ▴▴▴ ",
" ▪▪▴▴▴ ",
" ▪▪▪▴▦▦ ",
" ▪▪▴▦▦▦ ",
" ▴▴▴▦▦▦ ",
" ▴▴▴▦ ",
" ▴▴ ",
" "
)

@@ -626,3 +626,3 @@ );

it('180 degrees', () => {
it("180 degrees", () => {
imgSrc

@@ -634,8 +634,8 @@ .clone()

mkJGD(
' ',
' ▴▴▴▴▦▦▦▦ ',
' ▴▴▴▴▦▦▦▦ ',
' ▪▪▪▪▴▴▴▴ ',
' ▪▪▪▪▴▴▴▴ ',
' '
" ",
" ▴▴▴▴▦▦▦▦ ",
" ▴▴▴▴▦▦▦▦ ",
" ▪▪▪▪▴▴▴▴ ",
" ▪▪▪▪▴▴▴▴ ",
" "
)

@@ -645,3 +645,3 @@ );

it('225 degrees', () => {
it("225 degrees", () => {
imgSrc

@@ -653,12 +653,12 @@ .clone()

mkJGD(
' ▦ ',
' ▦▦▦ ',
' ▦▦▦▴▴ ',
' ▴▦▦▴▴▴ ',
' ▴▴▴▴▴▴ ',
' ▴▴▴▪▪▴ ',
' ▴▪▪▪ ',
' ▪▪ ',
' ',
' '
" ▦ ",
" ▦▦▦ ",
" ▦▦▦▴▴ ",
" ▴▦▦▴▴▴ ",
" ▴▴▴▴▴▴ ",
" ▴▴▴▪▪▴ ",
" ▴▪▪▪ ",
" ▪▪ ",
" ",
" "
)

@@ -668,3 +668,3 @@ );

it('315 degrees', () => {
it("315 degrees", () => {
imgSrc

@@ -676,12 +676,12 @@ .clone()

mkJGD(
' ▴▴ ',
' ▦▴▴▴ ',
'▦▦▦▴▴▴ ',
' ▦▦▦▴▪▪ ',
' ▦▦▴▪▪▪ ',
' ▴▴▴▪▪ ',
' ▴▴▴ ',
' ▴ ',
' ',
' '
" ▴▴ ",
" ▦▴▴▴ ",
"▦▦▦▴▴▴ ",
" ▦▦▦▴▪▪ ",
" ▦▦▴▪▪▪ ",
" ▴▴▴▪▪ ",
" ▴▴▴ ",
" ▴ ",
" ",
" "
)

@@ -688,0 +688,0 @@ );

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc