qrtool-decode1
Detect and decode a qr code
Usage
qrtool decode
[OPTION] ...
[IMAGE]
Overview
This command detects and decodes a QR code <https://www.qrcode.com> from a raster or vector image. By default, the result will be output to standard output.
Supported image file formats
• BMP <https://en.wikipedia.org/wiki/BMP_file_format> (if enabled at compile time)
• DDS <https://en.wikipedia.org/wiki/DirectDraw_Surface> (if enabled at compile time)
• Farbfeld <https://tools.suckless.org/farbfeld/> (if enabled at compile time)
• GIF <https://en.wikipedia.org/wiki/GIF> (if enabled at compile time)
• Radiance RGBE <https://en.wikipedia.org/wiki/RGBE_image_format> (if enabled at compile time)
• ICO <https://en.wikipedia.org/wiki/ICO_(file_format)> (if enabled at compile time)
• JPEG <https://jpeg.org/jpeg/> (if enabled at compile time)
• OpenEXR <https://openexr.com/> (if enabled at compile time)
• PNG <https://en.wikipedia.org/wiki/PNG>
• PNM <https://netpbm.sourceforge.net/doc/pnm.html> (if enabled at compile time)
• QOI <https://qoiformat.org/> (if enabled at compile time)
• SVG <https://www.w3.org/Graphics/SVG/> (if enabled at compile time)
• TGA <https://en.wikipedia.org/wiki/Truevision_TGA> (if enabled at compile time)
• TIFF <https://en.wikipedia.org/wiki/TIFF> (if enabled at compile time)
• WebP <https://developers.google.com/speed/webp/> (if enabled at compile time)
• XBM <https://en.wikipedia.org/wiki/X_BitMap> (if enabled at compile time)
Use -t option to specify the image format. If this option is not specified, the image format is determined based on the extension or the magic number.
Caution
This command only supports decoding a normal QR code <https://www.qrcode.com/codes/model12.html>, and does not support decoding a Micro QR code <https://www.qrcode.com/codes/microqr.html> and a rMQR code <https://www.qrcode.com/codes/rmqr.html>.
Positional arguments
IMAGE
Input image file. If IMAGE is not specified, or if "-" is specified, the image will be read from standard input. Supported raster image formats are based on the formats supported by the image <https://crates.io/crates/image> crate. The format of IMAGE is determined based on the extension or the magic number if possible. If the format cannot be determined, use --type. Note that the SVG image is rasterized before scanning.
Options
-
-t,--typeFORMAT -
The format of the input. IfFORMATis not specified, the format isdetermined based on the extension or the magic number.The possible values are:bmpWindows Bitmap. This value is available if the decode-from-bmp featureis enabled at compile time.ddsDirectDraw Surface. This value is available if the decode-from-ddsfeature is enabled at compile time.farbfeldFarbfeld. This value is available if the decode-from-ff feature isenabled at compile time.gifGraphics Interchange Format. This value is available if thedecode-from-gif feature is enabled at compile time.hdrRadiance RGBE. This value is available if the decode-from-hdr featureis enabled at compile time.icoICO file format. This value also includes the CUR file format. This valueis available if the decode-from-ico feature is enabled at compile time.jpegJPEG. This value is available if the decode-from-jpeg feature isenabled at compile time.openexrOpenEXR. This value is available if the decode-from-exr feature isenabled at compile time.pngPortable Network Graphics.pnmPortable Anymap Format. This value is available if the decode-from-pnmfeature is enabled at compile time.qoiQuite OK Image Format. This value is available if the decode-from-qoifeature is enabled at compile time.svgScalable Vector Graphics. This value also includes the gzip-compressedSVG image. This value is available if the decode-from-svg feature isenabled at compile time.tgaTruevision TGA. This value is available if the decode-from-tga featureis enabled at compile time.tiffTag Image File Format. This value is available if the decode-from-tifffeature is enabled at compile time.webpWebP. This value is available if the decode-from-webp feature isenabled at compile time.xbmX BitMap. This value is available if the decode-from-xbm feature isenabled at compile time.
-
--verbose -
Also print the metadata. It is output to stderr. This option conflicts with--metadata.
-
--metadata -
Print only the metadata. It is output to stderr. This option conflicts with--verbose.
-
-h,--help -
Print help message. The short flag (-h) will print a condensed help messagewhile the long flag (--help) will print a detailed help message.
-
-V,--version -
Print version number.
Exit status
0
Successful program execution.
1
An error occurred.
2
An error occurred while parsing command-line arguments.
Exit statuses other than these are defined by <sysexits.h> <https://man.openbsd.org/sysexits>.
Notes
Source repository:
<https://github.com/sorairolake/qrtool>
Examples
Detect and decode a QR code from the given image:
$ qrtool decode input.png
Decode a QR code from the given WebP image:
$ qrtool decode -t webp input.webp
Also print the metadata when decoding a QR code:
$ qrtool decode --verbose input.qoi