
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Efficient image resize with support for multiple thumbnail configurations using
ImageMagick's convert
command.
npm install im-resize --save
var resize = require('im-resize');
image
, object output
, function cb
)Resize a given source image
into several versions
.
image
- source image to resize
width
- image pixel widthheight
- image pixel heightpath
- complete path to source imageoutput
- image resize output config
prefix
image versions name prefix (default ""
)path
image versions directory pathquality
- global version quality (default 80
)versions
- array of version objects
suffix
- suffix for the resized image (ex. -small
)maxWidth
- max width for resized imagemaxHeight
- max height for resized imagequality
- quality for resized image (default 80
)aspect
- force aspectratio on resized image (ex. 4:3
)flatten
- used in conjunction with backgroundbackground
- set background to transparent image (ex. red
)format
- image format for resized image (ex. png
)cb
- callback function (Error error
, object[] versions
)
error
- error output if command failedversions
- resized image versions
path
path to the resized imagevar image = {
path: '/path/to/image.jpg',
width: 5184,
height: 2623
};
var output = {
versions: [{
suffix: '-thumb',
maxHeight: 150,
maxWidth: 150,
aspect: "3:2"
},{
suffix: '-square',
maxWidth: 200,
aspect: "1:1"
}]
};
resize(image, output, function(error, versions) {
if (error) { console.error(error); }
console.log(versions[0].path); // /path/to/image-thumb.jpg
console.log(versions[0].width); // 150
console.log(versions[0].height); // 100
console.log(versions[1].path); // /path/to/image-square.jpg
console.log(versions[1].width); // 200
console.log(versions[1].height); // 200
});
FAQs
Efficient image resize with multiple versions support
We found that im-resize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.