From f7f8680eb3e0d18d822a4b3ed07dbc03465f8bb0 Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Mon, 6 May 2024 17:24:31 +0200 Subject: [PATCH] fix doublePage issue when part crop are also a double page --- internal/epub/imageprocessor/epub_image_processor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/epub/imageprocessor/epub_image_processor.go b/internal/epub/imageprocessor/epub_image_processor.go index 12c4943..3f40d38 100644 --- a/internal/epub/imageprocessor/epub_image_processor.go +++ b/internal/epub/imageprocessor/epub_image_processor.go @@ -207,9 +207,10 @@ func (e *EPUBImageProcessor) transformImage(input *task, part int, right bool) * dstBounds := g.Bounds(src.Bounds()) // Original && Cropped version need to landscape oriented - isDoublePage := srcBounds.Dx() > srcBounds.Dy() && dstBounds.Dx() > dstBounds.Dy() + // Only part 0 can be a double page + isDoublePage := part == 0 && srcBounds.Dx() > srcBounds.Dy() && dstBounds.Dx() > dstBounds.Dy() - if part == 0 && e.Image.AutoRotate && isDoublePage { + if e.Image.AutoRotate && isDoublePage { g.Add(gift.Rotate90()) }