From 82aa66c363a0e213dfda6fdae4f830611fbb7c08 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:53:45 +0200 Subject: [PATCH] include title for epubpart --- internal/epub/epub.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/epub/epub.go b/internal/epub/epub.go index 00cb6eb..3c24aa0 100644 --- a/internal/epub/epub.go +++ b/internal/epub/epub.go @@ -160,8 +160,11 @@ func (e *ePub) getParts() ([]*epubPart, error) { maxSize := uint64(e.LimitMb * 1024 * 1024) xhtmlSize := uint64(1024) - // descriptor files + image + // descriptor files + title baseSize := uint64(16*1024) + cover.Data.CompressedSize() + if e.HasCover { + baseSize += cover.Data.CompressedSize() + } currentSize := baseSize currentImages := make([]*Image, 0) @@ -176,6 +179,9 @@ func (e *ePub) getParts() ([]*epubPart, error) { }) part += 1 currentSize = baseSize + if !e.HasCover { + currentSize += cover.Data.CompressedSize() + } currentImages = make([]*Image, 0) } currentSize += imgSize