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"