goraw

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

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

GoDoc Build Status

goraw

A go library to read raw files

This library currently exposes simple parsers to access Exif metadata inside the raw files.

Are currently supported:

  • canon import _ "github.com/tjamet/goraw/canon"
  • nikon import _ "github.com/tjamet/goraw/nikon"
  • fujifilm import _ "github.com/tjamet/goraw/fuji"

To use the library, please see example_test.go

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFormat

func RegisterFormat(name string, magic []byte, decode func(io.ReaderAt) (Decoder, error))

RegisterFormat registers a new raw format

Types

type Decoder

type Decoder interface {
	ExifReaderAt() (io.ReaderAt, error)
}

Decoder defines the interface to implement a new raw decoder

func New

func New(r io.ReaderAt) (Decoder, error)

New instanciates a decoder from a ReaderAt by detecting its format

func Open

func Open(filename string) (Decoder, error)

Open instanciates a decoder from a file by detecting its format

Example
package main

import (
	"fmt"

	"github.com/tjamet/goraw"

	_ "github.com/tjamet/goraw/fuji"
	tools "github.com/tjamet/goraw/test-tools"
)

func main() {
	testFile := tools.DownloadRAW("http://www.rawsamples.ch/raws/fuji/RAW_FUJI_FINEPIX_X100.RAF")
	decoder, _ := goraw.Open(testFile)
	reader, _ := decoder.ExifReaderAt()
	order := make([]byte, 2)
	reader.ReadAt(order, 0)
	fmt.Println(string(order))
}
Output:

II

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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