img

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package img has the functions to convert, compress and resize the images.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNamed     = errors.New("named path cannot be empty")
	ErrDest      = errors.New("dest path cannot be empty")
	ErrSharedLib = errors.New("cannot access shared libraries: libansilove.so.1")
	ErrType      = errors.New("mimetype is not a known text file")

	ErrResize = errors.New("resize only works with the png image format")
)

Functions

func Bytes added in v1.11.0

func Bytes(name string) (uint64, error)

func Export added in v1.11.0

func Export(name, dest string, amiga bool) (string, error)

Export any supported text based named file to a compressed PNG image. helpful: https://www.programming-books.io/essential/go /images-png-jpeg-bmp-tiff-webp-vp8-gif-c84a45304ec3498081c67aa1ea0d9c49.

func Make added in v1.11.0

func Make(w io.Writer, cfg conf.Config, name, uuid string, amiga bool) error

Make both PNG and Webp preview images and a 400x PNG thumbnail from the named text files. Name is the source text file required for conversion to an image. UUID is the universal ID used for the image filename. When the amiga bool is true the image text will use an Amiga era Topaz+, 80x50 font.

func Reduce

func Reduce(w io.Writer, named, uuid string) (string, error)

Reduce the length of the named textfile so it can be parsed by AnsiLove.

func Resize added in v1.11.0

func Resize(w io.Writer, name string) error

Resize the named image so it is compatible with the format restrictions of WebP.

func Type added in v1.11.0

func Type(name string) error

Type of the named document is checked and an error is returned for an unknown binary format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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