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

image-clipper

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-clipper - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

4

lib/index.js

@@ -16,6 +16,4 @@ var Clipper = require('./clipper');

case 1:
var sourceType = utils.type(source);
// imageClipper({...})
if (sourceType === 'Object') {
if (utils.type(source) === 'Object') {
clipper = new Clipper(source);

@@ -22,0 +20,0 @@ }

{
"name": "image-clipper",
"version": "0.4.0",
"version": "0.4.1",
"description": "Node.js module for clip & crop JPEG, PNG, WebP images purely using the native Canvas APIs, excellent compatibility with the Browser & Electron & NW.js (Node-webkit), itself doesn't relies on any image processing libraries.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -93,3 +93,3 @@ # image-clipper

Clipper('/path/to/image.jpg', function() {
.toFile('/path/to/result.jpg', function() {
this.toFile('/path/to/result.jpg', function() {
console.log('saved!');

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

Load image from memory.
Load image from memory. This process will be performed synchronously.

@@ -150,3 +150,3 @@ - **source:** anything ctx.drawImage() accepts, usually HTMLImageElement, HTMLCanvasElement, HTMLVideoElement or [ImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap). Keep in mind that [origin policies](https://en.wikipedia.org/wiki/Same-origin_policy) apply to the image source, and you may not use cross-domain images without [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing).

clipper.image('/path/to/image.jpg', function() {
.toFile('/path/to/result.jpg', function() {
this.toFile('/path/to/result.jpg', function() {
console.log('saved!');

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

Clipper('/path/to/image.jpg', function() {
.toFile('/path/to/result.jpg', function() {
this.toFile('/path/to/result.jpg', function() {
console.log('saved!');

@@ -366,3 +366,3 @@ });

Return the current Canvas object.
Return the current instance Canvas object.

@@ -377,3 +377,3 @@ ```js

Configure global properties. Properties changed by this method (same properties configurable through the constructor) will take effect for every instance created after the change.
Configure properties (same properties configurable through the constructor) for global or the instance.

@@ -383,8 +383,10 @@ ```js

Clipper.configure({
canvas: require('canvas')
canvas: require('canvas')
});
```
Or configure instance properties, this will only take effect for current instance and will override the global settings.
Properties changed by the `Clipper.configure` method will take effect for every instance created after the change.
Or you can configure instance properties, below will only take effect for current instance and will override the global settings.
```js

@@ -394,3 +396,3 @@ var Clipper = require('image-clipper');

clipper.configure({
canvas: require('canvas')
canvas: require('canvas')
});

@@ -397,0 +399,0 @@ ```

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