From 259bf6bb7b14e39ff765758be3cc623a25c958f4 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sun, 15 Jan 2023 15:38:24 +0100 Subject: [PATCH] split double page if necessary --- internal/epub/image_processing.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/epub/image_processing.go b/internal/epub/image_processing.go index 0e4be29..1eb3cd9 100644 --- a/internal/epub/image_processing.go +++ b/internal/epub/image_processing.go @@ -154,7 +154,14 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) { dst.Bounds().Dy(), } - if options.AutoSplitDoublePage && src.Bounds().Dx() > src.Bounds().Dy() { + // Auto split double page + // Except for cover + // Only if the src image have width > height and is bigger than the view + if img.Id > 0 && + options.AutoSplitDoublePage && + src.Bounds().Dx() > src.Bounds().Dy() && + src.Bounds().Dx() > options.ViewHeight && + src.Bounds().Dy() > options.ViewWidth { gifts := NewGiftSplitDoublePage(options) for i, g := range gifts { part := i + 1