cbz

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractChapter added in v2.7.0

func ExtractChapter(ctx context.Context, filePath string, keepFilenames bool) (*manga.Chapter, error)

ExtractChapter extracts an archive (CBZ/CBR) to a temp directory on disk. Pages are streamed directly to files — no image data is held in memory. Returns a Chapter with PageFile entries pointing to extracted files.

When keepFilenames is true, each PageFile has its OriginalName set to the base filename of the entry inside the archive. Downstream code uses that name to preserve the original page identity in the output CBZ (with the extension swapped for format conversion). When false, OriginalName stays empty and the sequential %04d naming convention is used instead.

func IsAlreadyConverted added in v2.7.0

func IsAlreadyConverted(ctx context.Context, filePath string) (converted bool, err error)

IsAlreadyConverted performs a fast check to see if the archive is already converted without extracting any image data. It reads only the zip comment and metadata files (converted.txt) to determine conversion status.

func LoadChapter

func LoadChapter(filePath string) (*manga.Chapter, error)

LoadChapter extracts the chapter from a CBZ/CBR file to disk. It delegates to ExtractChapter with keepFilenames=false and always extracts all pages. Use IsAlreadyConverted for a fast conversion status check without extraction.

func WriteChapterToCBZ

func WriteChapterToCBZ(chapter *manga.Chapter, outputFilePath string) (err error)

WriteChapterToCBZ creates a CBZ file from a Chapter by streaming page files from disk directly into the zip archive. No image data is held in memory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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