<commit_before>package findhdr

/*
TODO
----
- what about configurable # of shots?
- allow any variation of bias values
- should we really be treating bias value as a string? why didn't StringVal() work?
- support non-JPG filenames
- print out some stats afterwards
- configurable verbosity!
*/

import (
	"fmt"
	"mime"
	"os"
	"path/filepath"
	"strings"

	"github.com/rwcarlsen/goexif/exif"
)

func init() {
	addMimeTypes()
}

// Hdr represents a set of candidate images which may -- or may not -- represent
// valid sources for a single merged hdr image. See IsHdr() for details on
// what constitues valid sources.
type Hdr struct {
	a *Image
	b *Image
	c *Image
}

// Image represents a single image file and its metadata.
type Image struct {
	Path string
	Info os.FileInfo
	Meta ImageMeta
}

// ImageMeta is an interface providing access to image metadata.
type ImageMeta interface {
	PixelXDimension() (int, error)
	PixelYDimension() (int, error)
	ExposureBiasValue() (string, error)
}
<commit_msg>Switch exif library dependency to active fork. https://github.com/rwcarlsen/goexif has ceased development; to https://github.com/xor-gate/goexif2 is the active fork.<commit_after>package findhdr

/*
TODO
----
- what about configurable # of shots?
- allow any variation of bias values
- should we really be treating bias value as a string? why didn't StringVal() work?
- support non-JPG filenames
- print out some stats afterwards
- configurable verbosity!
*/

import (
	"fmt"
	"mime"
	"os"
	"path/filepath"
	"strings"

	"github.com/xor-gate/goexif2/exif"
)

func init() {
	addMimeTypes()
}

// Hdr represents a set of candidate images which may -- or may not -- represent
// valid sources for a single merged hdr image. See IsHdr() for details on
// what constitues valid sources.
type Hdr struct {
	a *Image
	b *Image
	c *Image
}

// Image represents a single image file and its metadata.
type Image struct {
	Path string
	Info os.FileInfo
	Meta ImageMeta
}

// ImageMeta is an interface providing access to image metadata.
type ImageMeta interface {
	PixelXDimension() (int, error)
	PixelYDimension() (int, error)
	ExposureBiasValue() (string, error)
}

{'fraction_non_alphanumeric': 0.0968489341983318, 'fraction_numerical': 0.0009267840593141798, 'mean_word_length': 3.7242888402625822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3648912', 'n_tokens_mistral': 691, 'n_tokens_neox': 679, 'n_words': 268}