New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

images

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

images - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

.gitmodules

27

index.js

@@ -9,6 +9,14 @@ var USE_OLD_API = false,

CONFIG_GENERATOR,
prototype;
prototype,
nextGCThreshold = 0,
gcThreshold = 0;
function WrappedImage(width, height) {
if (!(this instanceof WrappedImage)) return new WrappedImage(width, height);
if (gcThreshold && nextGCThreshold) {
if (images.getUsedMemory() > nextGCThreshold) {
images.gc();
nextGCThreshold = images.getUsedMemory() + gcThreshold;
}
}
this._handle = new _Image(width, height);

@@ -56,4 +64,4 @@ }

resize: function( width, height, filter ){
this._handle.resize( width, height, filter );
resize: function(width, height, filter) {
this._handle.resize(width, height, filter);
return this;

@@ -174,2 +182,15 @@ },

images.setGCThreshold = function(value) {
gcThreshold = value;
nextGCThreshold = value;
};
images.getUsedMemory = function() {
return _images.usedMemory;
};
images.gc = function() {
return _images.gc();
};
module.exports = USE_OLD_API ? _images : images;

17

map.json

@@ -7,9 +7,11 @@ {

"0.9.7",
"0.9.11"
"0.9.11",
"0.12.0"
],
"x64": [
"0.8.0",
"0.8.0",
"0.9.3",
"0.9.7",
"0.9.11"
"0.9.11",
"0.12.0"
]

@@ -23,3 +25,4 @@ },

"0.9.7",
"0.9.11"
"0.9.11",
"0.12.0"
],

@@ -30,3 +33,4 @@ "x64": [

"0.9.7",
"0.9.11"
"0.9.11",
"0.12.0"
]

@@ -40,5 +44,6 @@ },

"0.9.7",
"0.9.11"
"0.9.11",
"0.12.0"
]
}
}
{
"name": "images",
"version": "2.0.2",
"version": "2.1.0",
"description": "Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Node.js",

@@ -32,4 +32,5 @@ "main": "index.js",

"dependencies": {
"nan": "^1.6.2",
"step": "0.0.5"
}
}

@@ -106,2 +106,6 @@ ![images logo](https://raw.github.com/zhangyuanwei/node-images/master/demo/logo.png)

### .resize(width[, height])
Set the size of the image,if the height is not specified, then scaling based on the current width and height
设置图像宽高,如果height未指定,则根据当前宽高等比缩放, 默认采用 bicubic 算法。
### .width([width])

@@ -117,2 +121,14 @@ Get width for the image or set width of the image

Set the limit size of each image
设置库处理图片的大小限制,设置后对所有新的操作生效(如果超限则抛出异常)。
设置库处理图片的大小限制,设置后对所有新的操作生效(如果超限则抛出异常)
### images.setGCThreshold(value)
Set the garbage collection threshold
设置图像处理库自动gc的阈值(当*新增*内存使用超过该阈值时,执行垃圾回收)
### images.getUsedMemory()
Get used memory (in bytes)
得到图像处理库占用的内存大小(单位为字节)
### images.gc()
Forced call garbage collection
强制调用V8的垃圾回收机制

Sorry, the diff of this file is not supported yet

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