Gathering detailed insights and metrics for probe-image-size
Gathering detailed insights and metrics for probe-image-size
Gathering detailed insights and metrics for probe-image-size
Gathering detailed insights and metrics for probe-image-size
@types/probe-image-size
TypeScript definitions for probe-image-size
hexo-filter-probe-image-size
Probe and set image sizes in hexo web pages
co-probe-image-size
co version of probe-image-size, fix read large image error problem
probe-image-size-loader
Uses probe-image-size to inject the height and width into image imports.
Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
npm install probe-image-size
Typescript
Module System
Node Version
NPM Version
92.8
Supply Chain
98.7
Quality
75.4
Maintenance
100
Vulnerability
99.3
License
JavaScript (100%)
Total Downloads
164,371,777
Last Day
42,136
Last Week
666,144
Last Month
2,942,212
Last Year
30,660,486
MIT License
994 Stars
184 Commits
76 Forks
13 Watchers
2 Branches
11 Contributors
Updated on Jun 27, 2025
Minified
Minified + Gzipped
Latest Version
7.2.3
Package Id
probe-image-size@7.2.3
Unpacked Size
68.64 kB
Size
16.97 kB
File Count
32
NPM Version
8.1.0
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last Day
-4%
42,136
Compared to previous day
Last Week
-7.6%
666,144
Compared to previous week
Last Month
2.6%
2,942,212
Compared to previous month
Last Year
-3.8%
30,660,486
Compared to previous year
3
Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO, AVIF, HEIC, HEIF.
Key features:
1npm install probe-image-size
1const probe = require('probe-image-size'); 2 3// Get by URL 4let result = await probe('http://example.com/image.jpg'); 5console.log(result); // => 6/* 7 { 8 width: xx, 9 height: yy, 10 type: 'jpg', 11 mime: 'image/jpeg', 12 wUnits: 'px', 13 hUnits: 'px', 14 url: 'http://example.com/image.jpg' 15 } 16*/ 17 18 19// By URL with options 20let result = await probe('http://example.com/image.jpg', { rejectUnauthorized: false }); 21console.log(result); 22 23 24// From the stream 25let result = await probe(require('fs').createReadStream('image.jpg')); 26console.log(result); 27 28 29// From a Buffer (sync) 30let data = require('fs').readFileSync('image.jpg'); 31console.log(probe.sync(data));
Note:
stream.js
/ http.js
/ sync.js
directly.http.js
dependencies, you can create your own wrapper
for stream.js
.src
can be of this types:
options
- HTTP only. See needle
documentation, and customized defaults.keepOpen
(Boolean) - stream only. Keep stream open after parser finishes
(input stream will be closed by default)result
(Promise) contains:
1{ 2 width: XX, 3 height: YY, 4 length: ZZ, // byte length of the file (if available, HTTP only) 5 type: ..., // image 'type' (usual file name extention) 6 mime: ..., // mime type 7 wUnits: 'px', // width units type ('px' by default, can be different for SVG) 8 hUnits: 'px', // height units type ('px' by default, can be different for SVG) 9 url: ..., // HTTP only, last url for the image in chain of redirects 10 // (if no redirects, same as src) 11 12 // optional, image orientation (from Exif), number from 1 to 8; 13 // you may wish to swap width and height if orientation is >= 5 14 orientation: X, 15 16 // optional, full list of sizes for ICO (always) and AVIF (if multiple images) 17 variants: [ { width, height }, ... ] | undefined 18}
Width and height in the output object represent image size before any transformations (orientation, cropping) are applied. Orientation is returned separately, which you may wish to apply afterwards depending on browser support (browsers only support JPEG orientation for now). See known issues for details.
Returned errors can be extended with 2 fields:
code
- equals to ECONTENT
if the library failed to parse the file;status
- equals to a HTTP status code if it receives a non-200 response.Sync version can eat arrays, typed arrays and buffers. On success it returns the same result as async version. On fail it returns null.
Note. Formats like JPEG & TIFF can store size anywhere (far from the head). That usually does not happens, but if you need guarantees - always provide full file content to sync methods. We strongly recommend to use async version as memory-friendly.
You can support this project via Tidelift subscription.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
Found 3/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More