Installations
npm install @jcayzac/image-information
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.17.0
NPM Version
10.8.2
Score
68.1
Supply Chain
97.8
Quality
77.6
Maintenance
100
Vulnerability
100
License
Releases
@jcayzac/astro-image-service-ng@0.4.2-dev.0
Published on 01 Jan 2025
@jcayzac/atom-feeds@0.0.3-dev.0
Published on 31 Dec 2024
@copepod/kv@0.0.2
Published on 08 Oct 2024
@jcayzac/astro-image-service-ng@0.4.1
Published on 08 Oct 2024
@jcayzac/astro-image-service-ng@0.4.1-dev.0
Published on 08 Oct 2024
@copepod/kv@0.0.2-dev.0
Published on 08 Oct 2024
Contributors
Languages
TypeScript (90.24%)
CSS (8.99%)
JavaScript (0.65%)
Shell (0.12%)
Developer
jcayzac
Download Statistics
Total Downloads
584
Last Day
5
Last Week
7
Last Month
43
Last Year
584
GitHub Statistics
5 Stars
259 Commits
2 Forks
1 Watching
6 Branches
1 Contributors
Bundle Size
17.28 kB
Minified
5.59 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
1.1.1
Package Id
@jcayzac/image-information@1.1.1
Unpacked Size
17.02 kB
Size
5.91 kB
File Count
7
NPM Version
10.8.2
Node Version
20.17.0
Publised On
03 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
584
Last day
66.7%
5
Compared to previous day
Last week
-56.3%
7
Compared to previous week
Last month
72%
43
Compared to previous month
Last year
0%
584
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
@jcayzac/image-information
Lightweight detection of local or remote images' type, orientation & size in pure Javascript.
This module detect informations about local or remote images. For remote images, it streams the data only until it finds information.
Images in the following formats are supported: GIF, HEIC, HEIF, AVIF, J2C, JP2, JPEG, PNG, SVG & WebP.
Usage
1# pnpm 2pnpm add @jcayzac/image-information 3 4# bun 5bunx add @jcayzac/image-information 6 7# npm 8npx add @jcayzac/image-information 9 10# yarn 11yarn add @jcayzac/image-information 12 13# deno 14deno add npm:@jcayzac/image-information
Getting information about an image from a URL
1import { imageInformation } from '@jcayzac/image-information' 2 3// Remote URL 4const info = await imageInformation('https://example.com/image.jpg') 5if (info !== undefined) { 6 const { 7 // intrinsic width. 8 width, 9 10 // intrinsic height. 11 height, 12 13 // inferred file extension (doesn't care about URL). 14 extension, 15 16 // inferred MIME type. 17 type, 18 19 // detected EXIF orientation, if any. 20 orientation, 21 } = info 22 23 console.log(`Found information:`, info) 24} 25 26// File URL 27const info2 = await imageInformation('file:///tmp/image.jpg')
[!NOTE]
The function accepts strings as a convenience, but those are expected to represent valid URLs. For local images, you must use the
file://
URL scheme. Passing paths directly will not work.
Getting information about an image from a buffer
The probe()
function can be used to get information about an image from a buffer (either an Uint8Array
or a node Buffer
).
1import { readFile } from 'node:fs/promises' 2import { probe } from '@jcayzac/image-information' 3 4const buffer = await readFile('image.jpg') 5const info = await probe(buffer)
Like it? Buy me a coffee!
If you like anything here, consider buying me a coffee using one of the following platforms:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
10 out of 10 merged PRs checked by a CI test -- score normalized to 10
Reason
3 different organizations found -- score normalized to 10
Details
- Info: contributors work for rakutentech,rakutentech @rakutenlabs,w3c
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
- Info: tool 'Dependabot' is used: :0
Reason
license file detected
Details
- Info: License file found in expected location: LICENSE:1
- Info: FSF or OSI recognized license: LICENSE:1
Reason
30 commit(s) out of 30 and 0 issue activity out of 2 found in the last 90 days -- score normalized to 10
Reason
SAST tool is run on all commits
Details
- Info: all commits (28) are checked with a SAST tool
- Warn: CodeQL tool not detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: topLevel permissions set to 'read-all': .github/workflows/ci.yml:24
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/ci.yml:31
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/ci.yml:29
- Info: topLevel permissions set to 'read-all': .github/workflows/issue-labeled.yml:15
- Info: topLevel permissions set to 'read-all': .github/workflows/issue-needs-repro.yml:15
- Info: topLevel permissions set to 'read-all': .github/workflows/issue-opened.yml:17
- Info: topLevel permissions set to 'read-all': .github/workflows/main.yml:24
- Info: topLevel permissions set to 'read-all': .github/workflows/release.yml:23
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/release.yml:31
- Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:32: Verify which permissions are needed and consider whether you can reduce them. (High effort)
- Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:15
Reason
branch protection is not maximal on development and all release branches
Details
- Info: 'force pushes' disabled on branch 'main'
- Info: 'allow deletion' disabled on branch 'main'
- Warn: no status checks found to merge onto branch 'main'
- Warn: number of required reviewers is 0 on branch 'main'
- Warn: settings do not apply to administrators on branch 'main'
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:83: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/issue-labeled.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/issue-labeled.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/issue-labeled.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/issue-labeled.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/issue-needs-repro.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/issue-needs-repro.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/issue-opened.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/issue-opened.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scorecard.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/jcayzac/copepod-modules/scorecard.yml/main?enable=pin
- Info: 2 out of 12 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 9 third-party GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
found 7 unreviewed changesets out of 7 -- score normalized to 0
Reason
project is not fuzzed
Details
- Warn: no OSSFuzz integration found: Follow the steps in https://github.com/google/oss-fuzz to integrate fuzzing for your project. Over time, try to add fuzzing for more functionalities of your project. (High effort)
- Warn: no OneFuzz integration found: Follow the steps in https://github.com/microsoft/onefuzz to start fuzzing for your project. Over time, try to add fuzzing for more functionalities of your project. (High effort)
- Warn: no GoBuiltInFuzzer integration found: Follow the steps in https://go.dev/doc/fuzz/ to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no PythonAtherisFuzzer integration found: Follow the steps in https://github.com/google/atheris to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no CLibFuzzer integration found: Follow the steps in https://llvm.org/docs/LibFuzzer.html to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no CppLibFuzzer integration found: Follow the steps in https://llvm.org/docs/LibFuzzer.html to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no SwiftLibFuzzer integration found: Follow the steps in https://google.github.io/oss-fuzz/getting-started/new-project-guide/swift-lang/ to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no RustCargoFuzzer integration found: Follow the steps in https://rust-fuzz.github.io/book/cargo-fuzz.html to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no JavaJazzerFuzzer integration found: Follow the steps in https://github.com/CodeIntelligenceTesting/jazzer to enable fuzzing on your project. Over time, try to add fuzzing for more functionalities of your project. (Medium effort)
- Warn: no ClusterFuzzLite integration found: Follow the steps in https://github.com/google/clusterfuzzlite to integrate fuzzing as part of CI. Over time, try to add fuzzing for more functionalities of your project. (High effort)
- Warn: no HaskellPropertyBasedTesting integration found: Use one of the following frameworks to fuzz your project: QuickCheck: https://hackage.haskell.org/package/QuickCheck hedgehog: https://hedgehog.qa/ validity: https://github.com/NorfairKing/validity smallcheck: https://hackage.haskell.org/package/smallcheck hspec: https://hspec.github.io/ tasty: https://hackage.haskell.org/package/tasty (High effort)
- Warn: no TypeScriptPropertyBasedTesting integration found: Use fast-check: https://github.com/dubzzz/fast-check (High effort)
- Warn: no JavaScriptPropertyBasedTesting integration found: Use fast-check: https://github.com/dubzzz/fast-check (High effort)
Reason
security policy file not detected
Details
- Warn: no security policy file detected: On GitHub: Enable private vulnerability disclosure in your repository settings https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository Add a section in your SECURITY.md indicating you have enabled private reporting, and tell them to follow the steps in https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability to report vulnerabilities. On GitLab: Add a section in your SECURITY.md indicating the process to disclose vulnerabilities for your project. Examples: https://github.com/ossf/scorecard/blob/main/SECURITY.md, https://github.com/slsa-framework/slsa-github-generator/blob/main/SECURITY.md, https://github.com/sigstore/.github/blob/main/SECURITY.md. For additional information on vulnerability disclosure, see https://github.com/ossf/oss-vulnerability-guide/blob/main/maintainer-guide.md. (Medium effort)
- Warn: no security file to analyze: On GitHub: Enable private vulnerability disclosure in your repository settings https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository Add a section in your SECURITY.md indicating you have enabled private reporting, and tell them to follow the steps in https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability to report vulnerabilities. On GitLab: Provide a point of contact in your SECURITY.md. Examples: https://github.com/ossf/scorecard/blob/main/SECURITY.md, https://github.com/slsa-framework/slsa-github-generator/blob/main/SECURITY.md, https://github.com/sigstore/.github/blob/main/SECURITY.md. (Low effort)
- Warn: no security file to analyze: On GitHub: Enable private vulnerability disclosure in your repository settings https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository Add a section in your SECURITY.md indicating you have enabled private reporting, and tell them to follow the steps in https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability to report vulnerabilities. On GitLab: Add a section in your SECURITY.md indicating the process to disclose vulnerabilities for your project. Examples: https://github.com/ossf/scorecard/blob/main/SECURITY.md, https://github.com/slsa-framework/slsa-github-generator/blob/main/SECURITY.md, https://github.com/sigstore/.github/blob/main/SECURITY.md. (Low effort)
- Warn: no security file to analyze: On GitHub: Enable private vulnerability disclosure in your repository settings https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository Add a section in your SECURITY.md indicating you have enabled private reporting, and tell them to follow the steps in https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability to report vulnerabilities. On GitLab: Add a section in your SECURITY.md indicating the process to disclose vulnerabilities for your project. Examples: https://github.com/ossf/scorecard/blob/main/SECURITY.md, https://github.com/slsa-framework/slsa-github-generator/blob/main/SECURITY.md, https://github.com/sigstore/.github/blob/main/SECURITY.md. (Low effort)
Score
6.5
/10
Last Scanned on 2025-01-03T18:48:53Z
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