-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README: add install, usage, and example sections. * Update Makefile: static link on macOS. * Update workflows: add x86_64 & arm64 macOS.
- Loading branch information
1 parent
d24fe9b
commit 60ac539
Showing
4 changed files
with
90 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,85 @@ | ||
qrscan | ||
==== | ||
|
||
Scan a QR code in the terminal using a given image. | ||
  | ||
|
||
Scan a QR code in the terminal using a given (PNG or JPEG) image. | ||
|
||
## Install | ||
|
||
### Pre-built binaries (Recommends) | ||
|
||
Download the appropriate binary from the [latest release](https://github.com/redraiment/qrscan/releases/latest). | ||
|
||
### Build on Debian/Ubuntu Linux | ||
|
||
This requires pkg-config, libpng, and libjpeg. | ||
|
||
```sh | ||
sudo apt install --no-install-recommends -y pkg-config libpng-dev libjpeg-dev | ||
git clone --recurse-submodules https://github.com/redraiment/qrscan.git | ||
cd qrscan | ||
make | ||
sudo make install | ||
``` | ||
|
||
This requires: pkg-config, libpng, libjpeg. | ||
### Build on MacOS | ||
|
||
This requires pkg-config, libpng, and libjpeg. | ||
|
||
```sh | ||
brew install pkg-config libpng libjpeg | ||
git clone --recurse-submodules https://github.com/redraiment/qrscan.git | ||
cd qrscan | ||
make | ||
sudo make install | ||
``` | ||
|
||
## Usage | ||
|
||
Scan a given image file (possible format: png, jpg) | ||
`qrscan [OPTIONS] [PNG|JPG|-]` | ||
|
||
### Image Options | ||
|
||
* `--png`, `--jpg`: the format of the input file, inferred from the extension by default. | ||
* `-c`, `--count`: suppress normal output, instead print a count of QR-Code. | ||
* `-n NUM`, `--index NUM`: Output the NUM QR-Code value only. | ||
|
||
### Other Options | ||
|
||
* `-v`, `--version`: show the version and exit. | ||
* `-h`, `--help`: show help message and exit. | ||
|
||
## Examples | ||
|
||
1) Read from image file: | ||
|
||
```sh | ||
qrscan image.png | ||
``` | ||
|
||
2) Read from stdin: | ||
|
||
```sh | ||
cat image.jpg | qrscan --jpg - | ||
``` | ||
|
||
3) Count QR-Code in image: | ||
|
||
```sh | ||
qrscan path/to/file | ||
qrscan -c image.png | ||
``` | ||
|
||
# Or read from stdin | ||
4) Read the second QR-Code in image: | ||
|
||
cat path/to/file | qrscan - | ||
```sh | ||
qrscan -2 image.png | ||
# Or | ||
qrscan -n 2 image.png | ||
``` | ||
|
||
# License | ||
|
||
`qrscan` is open-source software, released under the MIT License. | ||
|
||
Feel free to explore, learn, and extend to suit your needs. |