From 54c156625cf079ebaab66444fcbec499d2bb62ae Mon Sep 17 00:00:00 2001 From: celogeek <65178+celogeek@users.noreply.github.com> Date: Sat, 14 Jan 2023 16:36:28 +0100 Subject: [PATCH] fix crop option --- .gitignore | 1 + internal/epub/image_processing.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/internal/epub/image_processing.go b/internal/epub/image_processing.go index 8a7567a..8f1d4eb 100644 --- a/internal/epub/image_processing.go +++ b/internal/epub/image_processing.go @@ -133,7 +133,7 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) { panic(err) } - if options.AutoRotate { + if options.Crop { g := gift.New(gift.Crop(findMarging(src))) newSrc := image.NewNRGBA(g.Bounds(src.Bounds())) g.Draw(newSrc, src)