diff --git a/internal/pkg/epubimage/epub_image.go b/internal/pkg/epubimage/epub_image.go index 6e8742c..330c24e 100644 --- a/internal/pkg/epubimage/epub_image.go +++ b/internal/pkg/epubimage/epub_image.go @@ -106,6 +106,10 @@ func (i EPUBImage) RelSize(viewWidth, viewHeight int) (relWidth, relHeight int) w, h := viewWidth, viewHeight srcw, srch := i.Width, i.Height + if srcw < w && srch < h { + return srcw, srch + } + if w <= 0 || h <= 0 || srcw <= 0 || srch <= 0 { return } diff --git a/internal/pkg/epubtemplates/blank.xhtml.tmpl b/internal/pkg/epubtemplates/blank.xhtml.tmpl index 0722dfc..88b3401 100644 --- a/internal/pkg/epubtemplates/blank.xhtml.tmpl +++ b/internal/pkg/epubtemplates/blank.xhtml.tmpl @@ -5,7 +5,6 @@ {{ .Title }} - diff --git a/internal/pkg/epubtemplates/text.xhtml.tmpl b/internal/pkg/epubtemplates/text.xhtml.tmpl index 21cea8f..6f2a349 100644 --- a/internal/pkg/epubtemplates/text.xhtml.tmpl +++ b/internal/pkg/epubtemplates/text.xhtml.tmpl @@ -5,7 +5,6 @@ {{ .Title }} - {{ .Title }}