diff --git a/internal/epub/image_filters.go b/internal/epub/image_filters.go index c2ec6e5..4839dba 100644 --- a/internal/epub/image_filters.go +++ b/internal/epub/image_filters.go @@ -20,6 +20,7 @@ func NewGift(options *ImageOptions) *gift.GIFT { } g.Add( gift.ResizeToFit(options.ViewWidth, options.ViewHeight, gift.LanczosResampling), + filters.Pixel(), ) return g } diff --git a/internal/epub/image_processing.go b/internal/epub/image_processing.go index 4d9d338..0e4be29 100644 --- a/internal/epub/image_processing.go +++ b/internal/epub/image_processing.go @@ -144,12 +144,7 @@ func LoadImages(path string, options *ImageOptions) ([]*Image, error) { // Convert image dst := image.NewPaletted(g.Bounds(src.Bounds()), options.Palette) - if dst.Bounds().Dx() == 0 || dst.Bounds().Dy() == 0 { - dst = image.NewPaletted(image.Rect(0, 0, 1, 1), dst.Palette) - dst.Set(0, 0, color.White) - } else { - g.Draw(dst, src) - } + g.Draw(dst, src) imageOutput <- &Image{ img.Id,