Documentation
¶
Overview ¶
Package ora opens OpenRaster and Krita files.
Both formats are zip archives that hold the layers of an image and the merged image, mergedimage.png. A document has one page, the merged image, and gives the thumbnail of the file as its preview (D11). A Krita file describes itself in documentinfo.xml: its title, its author, its subject, its language and its dates. The stack.xml of OpenRaster holds no such facts, only the size of the image and its layers. The package also registers both formats with the package image, so that image.Decode reads the merged image.
Index ¶
- Variables
- func Decode(r io.Reader) (image.Image, error)
- func DecodeConfig(r io.Reader) (image.Config, error)
- type Document
- func (d *Document) Close() error
- func (d *Document) Describe(ctx context.Context) (ivy.Info, error)
- func (d *Document) Mime() string
- func (d *Document) Page(_ context.Context, n int) (ivy.Page, error)
- func (d *Document) PageCount(context.Context) (int, error)
- func (d *Document) Previews(ctx context.Context) iter.Seq2[ivy.Preview, error]
- type Option
Constants ¶
This section is empty.
Variables ¶
var Format = ivy.Format{ Name: "ora", Mimes: []string{mimeORA, mimeKrita}, Exts: []string{"ora", "kra"}, Open: func(ctx context.Context, src ivy.Source, cfg ivy.Config) (ivy.Document, error) { return Open(ctx, src, WithConfig(cfg)) }, }
Format describes the package for the registry of a program.
Functions ¶
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an open OpenRaster or Krita file.
func Open ¶
Open opens an OpenRaster or a Krita file. It returns an error that wraps ivy.ErrFormat if src is neither.
func (*Document) Describe ¶
Describe satisfies the ivy.Describer interface. It reads the documentinfo.xml of a Krita file. An OpenRaster file has no facts.
func (*Document) Mime ¶
Mime returns the mime type that the file declares: "image/openraster" or "application/x-krita".