epubzip

package
v2.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Helper to write EPUB files.

We create a zip with the magic EPUB mimetype.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EPUBZip added in v2.4.0

type EPUBZip struct {
	// contains filtered or unexported fields
}

func New

func New(path string) (*EPUBZip, error)

create a new EPUB

func (*EPUBZip) Close added in v2.4.0

func (e *EPUBZip) Close() error

close compress pipe and file.

func (*EPUBZip) Copy added in v2.4.0

func (e *EPUBZip) Copy(fz *zip.File) error

func (*EPUBZip) WriteContent added in v2.4.0

func (e *EPUBZip) WriteContent(file string, content []byte) error

Write file. Compressed it using deflate.

func (*EPUBZip) WriteMagic added in v2.4.0

func (e *EPUBZip) WriteMagic() error

Write mimetype, in a very specific way. This will be valid with epubcheck tools.

func (*EPUBZip) WriteRaw added in v2.4.0

func (e *EPUBZip) WriteRaw(raw *ZipImage) error

Write image. They are already compressed, so we write them down directly.

type EPUBZipStorageImageReader added in v2.4.0

type EPUBZipStorageImageReader struct {
	// contains filtered or unexported fields
}

func NewEPUBZipStorageImageReader added in v2.4.0

func NewEPUBZipStorageImageReader(filename string) (*EPUBZipStorageImageReader, error)

func (*EPUBZipStorageImageReader) Close added in v2.4.0

func (e *EPUBZipStorageImageReader) Close() error

func (*EPUBZipStorageImageReader) Get added in v2.4.0

func (e *EPUBZipStorageImageReader) Get(filename string) *zip.File

func (*EPUBZipStorageImageReader) Remove added in v2.4.0

func (e *EPUBZipStorageImageReader) Remove() error

func (*EPUBZipStorageImageReader) Size added in v2.4.0

func (e *EPUBZipStorageImageReader) Size(filename string) uint64

type EPUBZipStorageImageWriter added in v2.4.0

type EPUBZipStorageImageWriter struct {
	// contains filtered or unexported fields
}

func NewEPUBZipStorageImageWriter added in v2.4.0

func NewEPUBZipStorageImageWriter(filename string, format string) (*EPUBZipStorageImageWriter, error)

func (*EPUBZipStorageImageWriter) Add added in v2.4.0

func (e *EPUBZipStorageImageWriter) Add(filename string, img image.Image, quality int) error

func (*EPUBZipStorageImageWriter) Close added in v2.4.0

func (e *EPUBZipStorageImageWriter) Close() error

type ZipImage added in v2.3.1

type ZipImage struct {
	Header *zip.FileHeader
	Data   []byte
}

func CompressImage added in v2.3.1

func CompressImage(filename string, format string, img image.Image, quality int) (*ZipImage, error)

create gzip encoded jpeg

Jump to

Keyboard shortcuts

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