// SPDX-FileCopyrightText: 2022 Shun Sakai
//
// SPDX-License-Identifier: CC-BY-4.0

= qrtool-decode(1)
// Specify in UTC.
:docdate: 2024-04-15
:doctype: manpage
ifdef::revnumber[:mansource: qrtool {revnumber}]
ifndef::revnumber[:mansource: qrtool]
:manmanual: General Commands Manual
ifndef::site-gen-antora[:includedir: ./include]

== NAME

qrtool-decode - detect and decode a QR code

== SYNOPSIS

*qrtool decode* [_OPTION_]... [_IMAGE_]

== DESCRIPTION

This command detects and decodes a QR code. By default, the result will be
output to stdout.

*qrtool dec* and *qrtool d* are aliases for this command.

== POSITIONAL ARGUMENTS

_IMAGE_::

  Input image file. If _IMAGE_ is not specified, or if "-" is specified, the
  image will be read from stdin. Supported raster image formats are based on
  the formats supported by the 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*, *--type* _FORMAT_::

  The format of the input. If _FORMAT_ is not specified, the format is
  determined based on the extension or the magic number.

  The possible values are:{blank}:::

ifdef::decode-from-bmp,env-github,site-gen-antora[]
    *bmp*::::

      Windows Bitmap.
endif::[]

ifdef::decode-from-dds,env-github,site-gen-antora[]
    *dds*::::

      DirectDraw Surface.
endif::[]

ifdef::decode-from-ff,env-github,site-gen-antora[]
    *farbfeld*::::

      Farbfeld.
endif::[]

ifdef::decode-from-gif,env-github,site-gen-antora[]
    *gif*::::

      Graphics Interchange Format.
endif::[]

ifdef::decode-from-hdr,env-github,site-gen-antora[]
    *hdr*::::

      Radiance RGBE.
endif::[]

ifdef::decode-from-ico,env-github,site-gen-antora[]
    *ico*::::

      ICO file format. This value also includes the CUR file format.
endif::[]

ifdef::decode-from-jpeg,env-github,site-gen-antora[]
    *jpeg*::::

      JPEG.
endif::[]

ifdef::decode-from-exr,env-github,site-gen-antora[]
    *openexr*::::

      OpenEXR.
endif::[]

    *png*::::

      Portable Network Graphics.

ifdef::decode-from-pnm,env-github,site-gen-antora[]
    *pnm*::::

      Portable Anymap Format.
endif::[]

ifdef::decode-from-qoi,env-github,site-gen-antora[]
    *qoi*::::

      Quite OK Image Format.
endif::[]

ifdef::decode-from-svg,env-github,site-gen-antora[]
    *svg*::::

      Scalable Vector Graphics. This value also includes the gzip-compressed
      SVG image.
endif::[]

ifdef::decode-from-tga,env-github,site-gen-antora[]
    *tga*::::

      Truevision TGA.
endif::[]

ifdef::decode-from-tiff,env-github,site-gen-antora[]
    *tiff*::::

      Tag Image File Format.
endif::[]

ifdef::decode-from-webp,env-github,site-gen-antora[]
    *webp*::::

      WebP.
endif::[]

*--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 message
  while the long flag (*--help*) will print a detailed help message.

*-V*, *--version*::

  Print version number. The long flag (*--version*) will also print the
  copyright notice, the license notice and where to report bugs.

ifndef::site-gen-antora[include::{includedir}/section-exit-status.adoc[]]
ifdef::site-gen-antora[include::partial$man/man1/include/section-exit-status.adoc[]]

== NOTES

Source repository:{blank}::

  https://github.com/sorairolake/qrtool

QR code.com:{blank}::

  https://www.qrcode.com/

image crate:{blank}::

  https://crates.io/crates/image

== EXAMPLES

Detect and decode a QR code from the given image:{blank}::

  $ *qrtool decode input.png*

Decode a QR code from the given WebP image:{blank}::

  $ *qrtool decode -t webp input.webp*

Also print the metadata when decoding a QR code:{blank}::

  $ *qrtool decode --verbose input.qoi*

ifndef::site-gen-antora[include::{includedir}/section-reporting-bugs.adoc[]]
ifdef::site-gen-antora[include::partial$man/man1/include/section-reporting-bugs.adoc[]]

ifndef::site-gen-antora[include::{includedir}/section-copyright.adoc[]]
ifdef::site-gen-antora[include::partial$man/man1/include/section-copyright.adoc[]]

== SEE ALSO

*qrtool*(1), *qrtool-encode*(1), *qrtool-help*(1), *zbarimg*(1)
