Documentation
¶
Overview ¶
Package comic opens comic book archives: CBZ, a zip archive of images, and CBT, a tar archive of images.
Each image is a page, in the natural order of the names, so that page2.jpg comes before page10.jpg. The first page is the cover (D11). A CBZ file whose images ZipCrypto or the AES of WinZip encrypts opens with the password of ivy.Config, or with its function PasswordFunc (D12). A document describes the comic from its ComicInfo.xml. CBR and CB7 need outside packages for RAR and 7z, and they come as modules of their own after the maintainers approve the packages (D6, D7).
Index ¶
- Variables
- type Document
- func (d *Document) Close() error
- func (d *Document) Describe(ctx context.Context) (ivy.Info, error)
- func (d *Document) Page(ctx 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: "comic", Mimes: []string{"application/vnd.comicbook+zip", "application/x-cbz", "application/x-cbt"}, Exts: []string{"cbz", "cbt"}, 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 ¶
This section is empty.
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document is an open comic book archive.
func Open ¶
Open opens a CBZ or a CBT file. It returns an error that wraps ivy.ErrFormat if src is neither a zip nor a tar archive.
func (*Document) Describe ¶
Describe satisfies the ivy.Describer interface. It reads the title, the writers, the language, the date, the publisher and the GTIN of the comic from its ComicInfo.xml. A comic without one has no facts. The title is the field Title, or the fields Series and Number. The GTIN is the field of ComicInfo 2.1 for an ISBN, an EAN or a UPC, and it is the identifier.
func (*Document) Page ¶
Page satisfies the ivy.Pager interface. It reads the size of the image, and decodes the image when the page renders.