metadata

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEXIFDecoder

func RegisterEXIFDecoder(d func(context.Context, []byte, bool, ...image.ReadOption) (*EXIF, error))

func RegisterEXIFEncoder

func RegisterEXIFEncoder(e func(context.Context, *EXIF, bool, ...image.WriteOption) ([]byte, error))

func RegisterICCDecoder

func RegisterICCDecoder(d func(context.Context, []byte, ...image.ReadOption) (*ICC, error))

func RegisterICCEncoder

func RegisterICCEncoder(e func(context.Context, *ICC, ...image.WriteOption) ([]byte, error))

func RegisterXMPDecoder

func RegisterXMPDecoder(d func(context.Context, string, ...image.ReadOption) (*XMP, error))

func RegisterXMPEncoder

func RegisterXMPEncoder(e func(context.Context, *XMP, ...image.WriteOption) (string, error))

Types

type Core

type Core struct {
	Contributor []string
	Coverage    string
	Creator     []string
	Date        []time.Time
	Description []LanguageAlternative
	Format      string // this is the mime type
	Identifier  string
	Language    []string // Really locales
	Publisher   []string
	Relation    []string
	Rights      []LanguageAlternative
	Source      string
	Subject     []string
	Title       []LanguageAlternative
	Type        []string
}

Things in the Dublin Core namespace

type EXIF

type EXIF struct {
	ImageWidth                uint32         // 256
	ImageHeight               uint32         // 257
	BitsPerSample             [3]uint16      // 258
	Compression               uint16         // 259
	PhotometricInterpretation uint16         // 262
	Orientation               uint16         // 274
	SamplesPerPixel           uint16         // 277
	PlanarConfiguration       uint16         // 284
	YCbCrSubsampling          [2]uint16      // 530
	YCbCrPositioning          uint16         // 531
	XResolution               Rational       // 282
	YResolution               Rational       // 283
	ResolutionUnit            uint16         // 296
	TransferFunction          [3][256]uint16 // 301
	WhitePoint                [2]Rational    // 318
	PrimaryChromaticities     [6]Rational    // 319
	YCbCrCoefficient          [3]Rational    // 529
	ReferenceBlackWhite       [6]Rational    // 532
	DateTime                  *time.Time     // 306
	ImageDescription          string         // 270
	Make                      string         // 271
	Model                     string         // 272
	Software                  string         // 305
	Artist                    string         // 315
	Copyright                 string         // 33432

}

func DecodeEXIF

func DecodeEXIF(ctx context.Context, b []byte, isBigEndian bool, opt ...image.ReadOption) (*EXIF, error)

func (*EXIF) Encode

func (x *EXIF) Encode(ctx context.Context, isBigEndian bool, opt ...image.WriteOption) ([]byte, error)

type GUID

type GUID string

These three are placeholders and should be fixed later

type ICC

type ICC struct {
	CMMTypeSignature                 uint32
	ProfileVersion                   ProfileVersion
	ProfileClassSignature            uint32
	ColorSpace                       uint32
	ProfileConnectionSpace           uint32
	ProfileCreationTime              time.Time
	PrimaryPlatformSignature         uint32
	CMMFlags                         uint32
	DeviceManufacturer               uint32
	DeviceModel                      uint32
	DeviceAttributes                 uint32
	RenderingIntent                  uint32
	ProfileConnectionSpaceIlluminant XYZNumber
	ProfileCreatorSignature          uint32
}

ICC holds an ICC color profile.

func DecodeICC

func DecodeICC(ctx context.Context, b []byte, opt ...image.ReadOption) (*ICC, error)

func (*ICC) Encode

func (x *ICC) Encode(ctx context.Context, opt ...image.WriteOption) ([]byte, error)

type LanguageAlternative

type LanguageAlternative struct {
	Language string
	Text     string
}

type ProfileVersion

type ProfileVersion struct {
	// Major holds a BCD encoded major version number.
	Major uint8
	// Minor holds a BCD encoded minor and patch number. The first digit
	// is the minor version while the second is the patch level.
	Minor uint8
}

ProfileVersion holds a BCD encoded profile version number.

type Rational

type Rational struct {
	Numerator   uint32
	Denomenator uint32
}

type RenditionClass

type RenditionClass string

type ResourceRef

type ResourceRef string

type Response16

type Response16 struct {
	// Interval holds the interval value
	Interval uint16
	// Measurement holds the measurement value.
	Measurement S15Fixed16
}

Response16 holds an iCC response16Number.

type S15Fixed16

type S15Fixed16 struct {
	Integer  int16
	Fraction uint16
}

S15Fixed16 holds a signed 32 bit fixed point number, with 1 sign bit, 15 integer bits, and 16 fractional bits.

type U16Fixed16

type U16Fixed16 struct {
	Integer  uint16
	Fraction uint16
}

U16Fixed16 holds an unsigned 32 bit fixed point number with 16 integer bits and 16 fractional bits.

type U8Fixed8

type U8Fixed8 struct {
	// Integer holds the unsigned 8 bit integer portion of the number.
	Integer uint8
	// Fraction holds the 8 bit fractional portion of the number.
	Fraction uint8
}

U8Fixed8 holds an unsigned 16 bit fixed point number, with 8 integer bits and 8 fraction bits.

type XMP

type XMP struct {
	CoreProperties  *Core
	Properties      *XMPSpecific
	Rights          *XMPRights
	MediaManagement *XMPMediaManagement
	IDQ             *XMPIDQ
}

XMP holds the XMP metadata. It's a collection of sub-types

func DecodeXMP

func DecodeXMP(ctx context.Context, b string, opt ...image.ReadOption) (*XMP, error)

func (*XMP) Encode

func (x *XMP) Encode(ctx context.Context, opt ...image.WriteOption) (string, error)

type XMPIDQ

type XMPIDQ struct {
	Scheme string
}

type XMPMediaManagement

type XMPMediaManagement struct {
	DerivedFrom        ResourceRef
	DocumentID         GUID
	InstanceID         GUID
	OriginalDocumentID GUID
	RenditionClass     RenditionClass
	RenditionParams    string
}

Things in the XMP Media Management namespace

type XMPRights

type XMPRights struct {
	Certificate  string
	Marked       *bool
	Owner        []string
	UsageTerms   []LanguageAlternative
	WebStatement string
}

Things in the XMP rights management namespace

type XMPSpecific

type XMPSpecific struct {
	CreateDate   *time.Time
	CreatorTool  string
	Identifier   []string
	Label        string
	MetadataData *time.Time
	ModifiedDate *time.Time
	Rating       float64
}

Things in the XMP namespace

type XYZNumber

type XYZNumber struct {
	X S15Fixed16
	Y S15Fixed16
	Z S15Fixed16
}

XYZ number holds a CIE XYZ tristimulus value.

Directories

Path Synopsis
Package exif encodes and decodes EXIF format image metadata.
Package exif encodes and decodes EXIF format image metadata.
Package icc encodes and decodes ICC color profiles.
Package icc encodes and decodes ICC color profiles.
Package xmp encodes and decodes XMP format image metadata.
Package xmp encodes and decodes XMP format image metadata.

Jump to

Keyboard shortcuts

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