Documentation
¶
Index ¶
- func NewImage(colorModel color.Model, bounds image.Rectangle) draw.Image
- func WriteImage(fname string, imgWithMetadata WithMetadata, compressionQuality int)
- type JPEGSegment
- func (s *JPEGSegment) Exif() (rootIfd *goexif.Ifd, data []byte, err error)
- func (s *JPEGSegment) IsExif() bool
- func (s *JPEGSegment) IsICC() bool
- func (s *JPEGSegment) IsIptc() bool
- func (s *JPEGSegment) IsJFIF() bool
- func (s *JPEGSegment) IsMetadata() bool
- func (s *JPEGSegment) IsXmp() bool
- func (s *JPEGSegment) SetExif(ib *goexif.IfdBuilder) error
- type Mutable
- type WithMetadata
- func (wm *WithMetadata) AddGPanoXMP() error
- func (wm *WithMetadata) AddThumbnail() error
- func (wm *WithMetadata) HasEXIFSegment() bool
- func (wm *WithMetadata) HasXMPSegment() bool
- func (wm *WithMetadata) MetadataTypes() []string
- func (wm *WithMetadata) RawSegments() []*jpegstructure.Segment
- func (wm *WithMetadata) XMPBytes() []byte
- func (wm *WithMetadata) XMPBytesSet(xmpBytes []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteImage ¶
func WriteImage(fname string, imgWithMetadata WithMetadata, compressionQuality int)
WriteImage writes to an image file. Compression is chosen based on the filename.
Types ¶
type JPEGSegment ¶
type JPEGSegment jpegstructure.Segment
JPEGSegment adds some more functions to jpegstructure.Segment. All functions we need from jpegstructure.Segment have to be wrapped on this type as well.
func (*JPEGSegment) Exif ¶
func (s *JPEGSegment) Exif() (rootIfd *goexif.Ifd, data []byte, err error)
func (*JPEGSegment) IsExif ¶
func (s *JPEGSegment) IsExif() bool
func (*JPEGSegment) IsICC ¶
func (s *JPEGSegment) IsICC() bool
ICC can be stored in multiple sequential JPEG segments, as the ICC profiles can be larger than a single segment allows.
func (*JPEGSegment) IsIptc ¶
func (s *JPEGSegment) IsIptc() bool
func (*JPEGSegment) IsJFIF ¶
func (s *JPEGSegment) IsJFIF() bool
func (*JPEGSegment) IsMetadata ¶
func (s *JPEGSegment) IsMetadata() bool
IsMetadata determines whether a segment is considered 'metadata', and thus has to be copied from the input file to the output of Skyfill.
func (*JPEGSegment) IsXmp ¶
func (s *JPEGSegment) IsXmp() bool
func (*JPEGSegment) SetExif ¶
func (s *JPEGSegment) SetExif(ib *goexif.IfdBuilder) error
type WithMetadata ¶
type WithMetadata struct { Image Mutable Format string Metadata []*JPEGSegment }
WithMetadata contains a mutable image with its JPEG metadata. The Metadata field is only non-nil if Format = "jpeg".
func LoadImage ¶
func LoadImage(filename string) WithMetadata
LoadImage loads an image, converting it to RGBA if necessary.
func (*WithMetadata) AddGPanoXMP ¶
func (wm *WithMetadata) AddGPanoXMP() error
AddGPanoXMP adds an XMP section indicating that this is a panorama photo.
- If there is no XMP metadata section yet, it is added.
- If there is XMP already, it is extended.
- If there is already a GPano section in there, this function assumes it is correct and doesn't touch it.
func (*WithMetadata) AddThumbnail ¶
func (wm *WithMetadata) AddThumbnail() error
AddThumbnail downscales the image to thumbnail size, and stores it as EXIF thumbnail.
func (*WithMetadata) HasEXIFSegment ¶
func (wm *WithMetadata) HasEXIFSegment() bool
func (*WithMetadata) HasXMPSegment ¶
func (wm *WithMetadata) HasXMPSegment() bool
func (*WithMetadata) MetadataTypes ¶
func (wm *WithMetadata) MetadataTypes() []string
MetadataTypes returns a slice of "EXIF", "IPTC", etc, depending on which metadata has been found. The returned slice has the same length as wm.Metadata.
func (*WithMetadata) RawSegments ¶
func (wm *WithMetadata) RawSegments() []*jpegstructure.Segment
func (*WithMetadata) XMPBytes ¶
func (wm *WithMetadata) XMPBytes() []byte
func (*WithMetadata) XMPBytesSet ¶
func (wm *WithMetadata) XMPBytesSet(xmpBytes []byte)