Skip to content

A small tool for image hash generation developed using Rust, supports simple renaming mode(一个用Rust开发的图像哈希生成小工具,支持简单重命名模式)

License

Notifications You must be signed in to change notification settings

zhangzhilinx/imghasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license release version open issues PRs Welcome

imghasher: Image Hash Generator

English 简体中文

A small tool for image hash generation developed using Rust, supports simple renaming mode

The output format is hex string (default lowercase) or base64 string


Installation

  • Download pre-compiled binaries from the Github Release page

  • Download source code and compile it

git clone https://github.com/zhangzhilinx/imghasher.git
cd imghasher
cargo install --path .
imghasher [ARGS]...
  • Soon cargo install imghasher will be supported!

Usage

imghasher 0.1.2
ZhangZhilin <[email protected]>
A tool for image hash generation developed using Rust

USAGE:
    imghasher [FLAGS] [OPTIONS] <FILE>...

FLAGS:
    -b, --base64         Output in base64
    -f, --force          Do not prompt before overwriting
    -h, --help           Prints help information
    -i, --interactive    Prompt before overwrite
    -q, --quiet          No output, suitable for rename mode
    -R, --recursive      Process directories recursively
        --rename         Rename the image file name to the corresponding hash
    -U, --upper          Output in uppercase, ignored in base64 mode
    -V, --version        Prints version information

OPTIONS:
    -a, --algo <algorithm>    Choose a hash algorithm [default: dhash]  [values: ahash, dct_ahash, dhash, dct_dhash]

ARGS:
    <FILE>...    Sets the input files or directories to use

The supported hash algorithms are:

  • ahash: Average Hash
  • dct_ahash: DCT-processed aHash, or pHash
  • dhash: Difference Hash / Gradient Hash
  • dct_dhash: DCT-processed dHash

However, the output of the dct_ahash algorithm implementation is a bit weird, so we suggest using dct_dhash instead.


TODO

  • Support for reading from standard input

  • Support for shell (e.g. bash) completions

  • Refinement of shell return codes (error codes)

  • Multi-threaded parallel support

  • Support for cargo install


Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'feat: add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © zhangzhilinx

About

A small tool for image hash generation developed using Rust, supports simple renaming mode(一个用Rust开发的图像哈希生成小工具,支持简单重命名模式)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages