epubzip

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package epubzip 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)

New 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

WriteContent Write file. Compressed it using deflate.

func (*EPUBZip) WriteMagic added in v2.4.0

func (e *EPUBZip) WriteMagic() error

WriteMagic 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

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

type StorageImageReader added in v2.7.0

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

func NewStorageImageReader added in v2.7.0

func NewStorageImageReader(filename string) (*StorageImageReader, error)

func (*StorageImageReader) Close added in v2.7.0

func (e *StorageImageReader) Close() error

func (*StorageImageReader) Get added in v2.7.0

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

func (*StorageImageReader) Remove added in v2.7.0

func (e *StorageImageReader) Remove() error

func (*StorageImageReader) Size added in v2.7.0

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

type StorageImageWriter added in v2.7.0

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

func NewStorageImageWriter added in v2.7.0

func NewStorageImageWriter(filename string, format string) (*StorageImageWriter, error)

func (*StorageImageWriter) Add added in v2.7.0

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

func (*StorageImageWriter) Close added in v2.7.0

func (e *StorageImageWriter) 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)

CompressImage create gzip encoded jpeg

Jump to

Keyboard shortcuts

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