tj3

package module
v0.0.0-...-c3d510b Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Go JPEG Encode and Decode via TurboJPEG v3

Simple JPEG Encoder and Decoder.

Replace

import (
    "image/jpeg"
)

with

import (
    jpeg "github.com/fzwoch/tj3"
)

or, if you only want the transparent decoding feature:

import (
    "image"
    _ "image/jpeg"
)

with

import (
    "image"
    _ "github.com/fzwoch/tj3"
)

Cgo

At build time of your application you will need to tell the Go compiler where to find the TurboJPEG header and library files. Check Go's cgo documentation for more details.

export CGO_CFLAGS="-I /path/to/libjpeg-turbo/header-files"
export CGO_LDFLAGS="-L /path/to/libjpeg-turbo/library"

Documentation

Index

Constants

View Source
const DefaultQuality = 75

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

func Encode

func Encode(w io.Writer, m image.Image, o *Options) error

Types

type Options

type Options struct {
	Quality int
}

Jump to

Keyboard shortcuts

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