
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.
image-magick-js
Advanced tools
ImageMagick wrapper for nodeJS.
ImageMagick should be installed on dev and prod machine in order to work.
For windows users you need to add a PATH env variable called "magick" and linking to magick.exe.
Latest release can be found at imagemagick.org.
Feel free to contribute.
More commands will come soon.
If you want one you can open an issue ticket.
Install using your package manager :
npm i --save image-magick-js
or
yarn add image-magick-js
Import the package in your js / ts file :
const magick = require("image-magick-js");
or
import magick from "image-magick-js";
Commands can be used with a classic promise or inside an async function using await.
Send custom command to magick.
Parameters :
options : string, magick command with custom options
const options = "convert -background lightblue -fill blue \
-pointsize 72 label:christophe \
label.gif";
magick.cmds
.custom(options)
.then((response) => console.log(response))
.catch((e) => {console.log(e);});
format
Parameters :
sourceFile : string, path to source image.
targetFile : string, path to target image.
magick.cmds
.convert.format("c:\\images\\a.png", "c:\\images\\a.jpg")
.then((response) => console.log(response))
.catch((e) => {console.log(e);});
resize
Parameters :
sourceFile : string, path to source image.
targetFile : string, path to target image (if the file doesn't exist it will be created).
resize : string, new size, can be "50%", "800x600" or "4096@".
force : boolean, optional, force the new size even if ratio is not preserved.
magick.cmds
.convert.resize(sourceFile, targetFile, resize, true)
.then((response) => console.log(response))
.catch((e) => {console.log(e);});
caption
Parameters :
targetFile : string, path to target image (if the file doesn't exist it will be created).
caption : string, text you want to write inside image.
pointSize : number, optional, font size.
size : string, optional, image ratio.
gravity : string, optional, text position ("Center", "South", "North", "East", "West", "NorthWest", "NorthEast", "SouthWest", "SouthEast").
magick.cmds
.convert.caption(targetFile, "Hello world", 40, "800x600", "Center")
.then((response) => console.log(response))
.catch((e) => {console.log(e);});
Parameters :
file : string, file to analyse
magick.cmds
.identify(file)
.then((response) => console.log(response))
.catch((e) => {console.log(e);});
response object is like this :
{
filename: string;
imageFormat: string;
widthXheight: string;
pageWidthXpageHeightXoffsetYoffset: string;
colorspace: string;
weight: string;
userTime: string;
elapsedTime: string;
error: string;
}
FAQs
ImageMagick wrapper javascript
The npm package image-magick-js receives a total of 2 weekly downloads. As such, image-magick-js popularity was classified as not popular.
We found that image-magick-js 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.