
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
batch-image-resizer
Advanced tools
CLI tool for resizing images using sharp and optimizing jpg
and png
files using imagemin. The CLI tool does not require imagemagick
or graphicsmagick
to be installed.
Supports both single files as well as recursive file finding and processing using a glob pattern.
$ npm install
Using the -s
flag followed by an array of numbers one can specify (in pixels) the image sizes one wants to resize their image(s) to.
The input flag -i
takes either a single parent directory or a single file. The script will recursivly find a copy all suitable input files in all child directories. The folder structure of the input folder is retained in the output folder. Please note that this does not happen in-place but rather in the output directory.
Running the following command turns
$ node ./bin/batch-image-resizer.js -i ./input -o ./output -s "[50, 500, 1000, 1500]"
This as input (root with a single image, a parent folder which has a single image and a child folder of the parent which contains a single image).
root
├── example-1.jpg
└── parent
├── child
│ └── example-3.jpg
└── example-2.jpg
Will in turn generate this as output (root with single image converted in various formats, a parent folder which contains a single image converted in various formats and a child folder of the parent which contains a single image converted in various formats).
root
├── example-1-1000w.jpg
├── example-1-1500w.jpg
├── example-1-500w.jpg
├── example-1-50w.jpg
└── parent
├── child
│ ├── example-3-1000w.jpg
│ ├── example-3-1500w.jpg
│ ├── example-3-500w.jpg
│ └── example-3-50w.jpg
├── example-2-1000w.jpg
├── example-2-1500w.jpg
├── example-2-500w.jpg
└── example-2-50w.jpg
Alternatively one could specify a single file as input rather than a directory.
$ node ./bin/batch-image-resizer.js -i ./input/example.png -o ./output/example.png -s "[50, 500, 1000, 1500]"
-v, --version [print version number]
-h, --help [print help]
-i, --input [example: -i ./input/example.png] [example: -i ./input] [required]
-o, --output [example: -o ./output/example.png] [example: -o ./output] [required]
-s, --sizes [example: -s "[50, 500, 1000, 1500]"] [not required]
-f, --fit [fit to largest dimension, either width or height] [not required]
-k, --keep-name [do not rename files] [not required]
<img
alt="Example image description"
srcset="example-500w.jpg 500w, example-1000w.jpg 1000w, example-1500w.jpg 1500w"
src="example-1000w.jpg"
/>
<picture>
<source srcset="example-500w.webp 500w, example-1000w.webp 1000w, example-1500w.webp 1500w" type="image/webp">
<source srcset="example-500w.jpg 500w, example-1000w.jpg 1000w, example-1500w.jpg 1500w" type="image/jpeg">
<img src="example-500w.jpg" alt="Example image description">
</picture>
My work is released under the MIT license.
FAQs
CLI tool for resizing and optimizing images.
The npm package batch-image-resizer receives a total of 1 weekly downloads. As such, batch-image-resizer popularity was classified as not popular.
We found that batch-image-resizer 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.