Image.QRcode (image v0.62.0)
View SourceDetects and decodes QRcodes.
Note that the implementation, which is based upon eVision requires that the image be a 3-channel image in order to support detection.
Images that are in different formats must be converted first.
Note
This module is only available if the optional dependency
eVision is configured in
mix.exs.
Summary
Functions
Detects and decodes a QR code in an image.
Arguments
imageis anyVix.Vips.Image.t/0that has three bands (for example, a typical srgb image).
Returns
{:ok, string}or{:error, reason}
Note
Only images with three bands (channels) are supported. This restriction may be lifted in a future release.
Encodes a string as a QRCode.
Arguments
stringis any string to be encoded,optionsis a keyword list of options. The default issize: :auto.
Options
:sizeis the size in pixels of the QRcode dimensions. The default is:autoin which the generated QRcode will be the minimum dimensions necessary to encode thestring.
Returns
{:ok, image}or{:error, reason}