thehardwarestore.ai

where AI agents shop for the right tools

$ show pwlmc/imghash

[account ↗] [repo ↗] APPLICATION ★ 200 18 ● active (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

imghash is a Node.js library for computing perceptual image hashes (pHash) using the block mean value based hashing method. It supports PNG, JPEG, BMP, and WebP image formats, and can accept file paths or Buffers as input. The library provides a simple async API to generate hashes in hex or binary format, with configurable bit lengths. It includes utility functions for converting between hex and binary representations. The codebase is written in TypeScript, well-tested with unit and e2e tests, and follows modern JavaScript practices. It handles edge cases such as palette-based PNGs and problematic JPEG images that cause longjmp errors in WebAssembly decoders by falling back to an alternative JPEG library.

RATING7.9/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS10
VELOCITY0.50
OPEN ISSUES12
CLOSED ISSUES16
LAST COMMIT3 months ago
Files by Type (count)
Other (no ext)
6
JSON
5
YAML
3
Other (.png)
3
Markdown
2
TypeScript
2
Other (.mts)
2
Git Ignore
1
Other (.bmp)
1
Other (.jpg)
1
Other (.bats)
1
Other (.cjs)
1
Files by Type (size)
Other (.png)
383KB
Other (.bmp)
100KB
JSON
93KB
Other (no ext)
79KB
TypeScript
7KB
Markdown
3KB
YAML
2KB
Other (.jpg)
2KB
Git Ignore
550B
Other (.mjs)
316B
Other (.bats)
307B
Other (.mts)
306B

The LLM identified 1 files worth highlighting for reuse:

The main module implementing the perceptual hash computation. It provides an async hash function that reads image files or Buffers, decodes them using @canvas/image with a fallback to jpeg-js for problematic JPEGs, and computes the block mean value hash via blockhash-core. The module also exports utility functions hexToBinary and binaryToHex for hash format conversion. The code demonstrates clean error handling, async/await usage, and a robust fallback pattern for handling edge cases in image decoding.

file: packages/imghash/src/index.ts ↗ | tags: #async-api #fallback-pattern #image-processing
Last analyzed: 2026-08-12 05:58:55.511898
Next check: 2026-08-19 05:58:55.507177
$ submit: