tiffstructure

package module
v2.0.0-...-8ecc4f5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TiffMediaContext

type TiffMediaContext struct {
	// contains filtered or unexported fields
}

TiffMediaContext encapsulates parsed EXIF data.

func (*TiffMediaContext) Exif

func (tmc *TiffMediaContext) Exif() (rootIfd *exif.Ifd, data []byte, err error)

Exif is an accessor that returns the root IFD.

type TiffMediaParser

type TiffMediaParser struct {
}

TiffMediaParser knows how to parse a TIFF stream.

func NewTiffMediaParser

func NewTiffMediaParser() *TiffMediaParser

NewTiffMediaParser returns a new `TiffMediaParser` struct.

func (*TiffMediaParser) GetImage

func (tmp *TiffMediaParser) GetImage(r io.Reader) (img image.Image, err error)

GetImage returns an image.Image-compatible struct.

func (*TiffMediaParser) LooksLikeFormat

func (tmp *TiffMediaParser) LooksLikeFormat(data []byte) bool

LooksLikeFormat returns a boolean indicating whether this looks like a TIFF stream.

Example
filepath := getTestExifImageFilepath()

data, err := ioutil.ReadFile(filepath)
log.PanicIf(err)

pmp := NewTiffMediaParser()

isPng := pmp.LooksLikeFormat(data)
fmt.Printf("%v\n", isPng)
Output:

true

func (*TiffMediaParser) Parse

func (tmp *TiffMediaParser) Parse(rs io.ReadSeeker, size int) (mc riimage.MediaContext, err error)

Parse parses a TIFF stream given a `io.ReadSeeker`.

func (*TiffMediaParser) ParseBytes

func (tmp *TiffMediaParser) ParseBytes(data []byte) (mc riimage.MediaContext, err error)

ParseBytes parses a TIFF stream given a byte-slice.

func (*TiffMediaParser) ParseFile

func (tmp *TiffMediaParser) ParseFile(filepath string) (mc riimage.MediaContext, err error)

ParseFile parses a TIFF stream given a file-path.

Directories

Path Synopsis
command

Jump to

Keyboard shortcuts

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