mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 07:42:37 +02:00
use epubimage format instead of global params
This commit is contained in:
parent
a5ef2a2927
commit
87a127d04a
@ -73,6 +73,11 @@ func (i EPUBImage) EPUBImgPath() string {
|
||||
return "OEBPS/" + i.ImgPath()
|
||||
}
|
||||
|
||||
// MediaType of the epub image
|
||||
func (i EPUBImage) MediaType() string {
|
||||
return "image/" + i.Format
|
||||
}
|
||||
|
||||
// ImgStyle style to apply to the image.
|
||||
//
|
||||
// center by default.
|
||||
|
@ -144,7 +144,7 @@ func (o Content) getManifest() []tag {
|
||||
var imageTags, pageTags, spaceTags []tag
|
||||
addTag := func(img epubimage.EPUBImage, withSpace bool) {
|
||||
imageTags = append(imageTags,
|
||||
tag{"item", tagAttrs{"id": img.ImgKey(), "href": img.ImgPath(), "media-type": o.ImageOptions.MediaType()}, ""},
|
||||
tag{"item", tagAttrs{"id": img.ImgKey(), "href": img.ImgPath(), "media-type": img.MediaType()}, ""},
|
||||
)
|
||||
pageTags = append(pageTags,
|
||||
tag{"item", tagAttrs{"id": img.PageKey(), "href": img.PagePath(), "media-type": "application/xhtml+xml"}, ""},
|
||||
|
@ -20,7 +20,3 @@ type Image struct {
|
||||
Format string `yaml:"format" json:"format"`
|
||||
AppleBookCompatibility bool `yaml:"apple_book_compatibility" json:"apple_book_compatibility"`
|
||||
}
|
||||
|
||||
func (i Image) MediaType() string {
|
||||
return "image/" + i.Format
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user