qrlogo

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2022 License: MIT Imports: 6 Imported by: 0

README

Tests Go Report Card Go Reference

Intro

QRLogo is a small library and command line to generate QR images with small logo placed in the center.

Thanks to redundancy in the QR codes nature, code remains readable even if part of its covered by image, i.e. logo. It allows creating nice branded-like QR codes.

Demo

Install

To install command line tool:

go get github.com/delivery-club/cmd/qrlogo

Or only lib (basically, the same, but without installing binary):

go get github.com/delivery-club/qrlogo

Usage

Command line tool

For command line tool, it's enough to specify input image (i.e. logo) and text or URL to be encoded:

qrlogo -i logo.jpeg https://delivery-club.ru

Output will be written to qr.png file in PNG format by default but also supports: jpeg.

You can also specify output filename and image size (512px by default). See -help output for details.

Note, that resizing logo image is up to you, it will be placed on top of resulting QR code without resizing or guessing proportions.

Library

For the library, usually it's enough to call only qrlogo.Encode() function. See Documentation for more details or test examples.

Supported picture formats (in/out):

  • png
  • jpeg
  • jpg

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(content string, logo image.Image, size int, outputFormat string) (*bytes.Buffer, error)

Encode encodes QR image, adds logo overlay and renders result.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL