Skip to main content

Crate rosetta_squint

Crate rosetta_squint 

Source
Expand description

rosetta-squint — point at an image (path or bytes), get the same hash hex string as every other rosetta-squint port for the same input.

§Examples

use rosetta_squint::{phash, phash_bytes};

let h = phash("photo.jpg", 8).unwrap();
println!("{}", h);

Structs§

Hash
ImageMultiHash
A collection of per-segment hashes produced by crop_resistant_hash.

Enums§

RosettaError

Constants§

MAX_FILE_SIZE
Reject path-based decode of files that are too large or are non-regular (e.g., /dev/zero, named pipes, character devices) BEFORE reading bytes. Callers that genuinely need to process images larger than this threshold should decode via rosetta-squint-decode directly after explicit validation.

Functions§

average_hash
Compute average_hash from a file path.
average_hash_bytes
Compute average_hash from raw bytes.
colorhash
Compute colorhash from a file path.
colorhash_bytes
Compute colorhash from raw bytes.
crop_resistant_hash
Compute crop_resistant_hash from a file path.
crop_resistant_hash_bytes
Compute crop_resistant_hash from raw bytes.
decode_file
Read a file from disk and decode it to a DynamicImage.
decode_to_image
Decode raw image bytes via rosetta-squint-decode and return a DynamicImage.
dhash
Compute dhash from a file path.
dhash_bytes
Compute dhash from raw bytes.
dhash_vertical
Compute dhash_vertical from a file path.
dhash_vertical_bytes
Compute dhash_vertical from raw bytes.
hex_to_flathash
hex_to_hash
hex_to_multihash
Parse a comma-separated multi-hash hex string into an ImageMultiHash.
phash
Compute phash from a file path.
phash_bytes
Compute phash from raw bytes.
phash_simple
Compute phash_simple from a file path.
phash_simple_bytes
Compute phash_simple from raw bytes.
whash_db4
Compute whash_db4 from a file path.
whash_db4_bytes
Compute whash_db4 from raw bytes.
whash_db4_robust
Compute whash_db4_robust from a file path.
whash_db4_robust_bytes
Compute whash_db4_robust from raw bytes.
whash_haar
Compute whash_haar from a file path.
whash_haar_bytes
Compute whash_haar from raw bytes.