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

@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.6.4 to 0.6.5-canary.784.118.0

19

dist/index.js

@@ -12,19 +12,2 @@ "use strict";

function rotate90degrees(bitmap, dstBuffer, clockwise) {
var dstOffsetStep = clockwise ? -4 : 4;
var dstOffset = clockwise ? dstBuffer.length - 4 : 0;
var tmp;
var x;
var y;
var srcOffset;
for (x = 0; x < bitmap.width; x++) {
for (y = bitmap.height - 1; y >= 0; y--) {
srcOffset = bitmap.width * y + x << 2;
tmp = bitmap.data.readUInt32BE(srcOffset, true);
dstBuffer.writeUInt32BE(tmp, dstOffset, true);
dstOffset += dstOffsetStep;
}
}
}
/**

@@ -35,4 +18,2 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.

*/
function advancedRotate(deg, mode) {

@@ -39,0 +20,0 @@ deg %= 360;

import { throwError, isNodePattern } from '@jimp/utils';
function rotate90degrees(bitmap, dstBuffer, clockwise) {
var dstOffsetStep = clockwise ? -4 : 4;
var dstOffset = clockwise ? dstBuffer.length - 4 : 0;
var tmp;
var x;
var y;
var srcOffset;
for (x = 0; x < bitmap.width; x++) {
for (y = bitmap.height - 1; y >= 0; y--) {
srcOffset = bitmap.width * y + x << 2;
tmp = bitmap.data.readUInt32BE(srcOffset, true);
dstBuffer.writeUInt32BE(tmp, dstOffset, true);
dstOffset += dstOffsetStep;
}
}
}
/**

@@ -26,3 +8,2 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.

function advancedRotate(deg, mode) {

@@ -29,0 +10,0 @@ deg %= 360;

16

package.json
{
"name": "@jimp/plugin-rotate",
"version": "0.6.4",
"version": "0.6.5-canary.784.118.0",
"description": "Rotate an image.",

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

"dependencies": {
"@jimp/utils": "^0.6.4",
"@jimp/utils": "0.6.5-canary.784.118.0",
"core-js": "^2.5.7"

@@ -33,7 +33,7 @@ },

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

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

},
"gitHead": "7c9d3c817cade88d4a20422be10670d3c1528429"
"gitHead": "20a24e11c6ef9b5ff9ed731f9a2d356fb8142518"
}
import { throwError, isNodePattern } from '@jimp/utils';
function rotate90degrees(bitmap, dstBuffer, clockwise) {
const dstOffsetStep = clockwise ? -4 : 4;
let dstOffset = clockwise ? dstBuffer.length - 4 : 0;
let tmp;
let x;
let y;
let srcOffset;
for (x = 0; x < bitmap.width; x++) {
for (y = bitmap.height - 1; y >= 0; y--) {
srcOffset = (bitmap.width * y + x) << 2;
tmp = bitmap.data.readUInt32BE(srcOffset, true);
dstBuffer.writeUInt32BE(tmp, dstOffset, true);
dstOffset += dstOffsetStep;
}
}
}
/**

@@ -23,0 +4,0 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.

Sorry, the diff of this file is not supported yet

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