cr2

package
v0.0.0-...-016f308 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cr2 implements rudimentary support for reading Canon Camera Raw 2 (CR2) files.

CR2 is a bastardized TIFF file with a JPEG file inside it (yeah, thanks Canon). This package is a stripped back version of code.google.com/p/go.image/tiff.

Known limitations:

Because TIFF files and CR2 files share the same first few bytes, the image package's file type detection will fail to recognize a cr2 if the tiff reader is also imported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

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

Decode reads a CR2 image from r and returns the embedded JPEG thumbnail as an image.Image.

func DecodeConfig

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

DecodeConfig returns the color model and dimensions of a TIFF image without decoding the entire image.

func NewReader

func NewReader(r io.Reader) (io.Reader, error)

NewReader returns an io.Reader to the JPEG thumbnail embedded in the CR2 image in r. This allows access to the raw bytes of the JPEG thumbnail without the need to decompress it first.

Types

type FormatError

type FormatError string

A FormatError reports that the input is not a valid TIFF image.

func (FormatError) Error

func (e FormatError) Error() string

type InternalError

type InternalError string

An InternalError reports that an internal error was encountered.

func (InternalError) Error

func (e InternalError) Error() string

type UnsupportedError

type UnsupportedError string

An UnsupportedError reports that the input uses a valid but unimplemented feature.

func (UnsupportedError) Error

func (e UnsupportedError) Error() string

Jump to

Keyboard shortcuts

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