mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +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()
|
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.
|
// ImgStyle style to apply to the image.
|
||||||
//
|
//
|
||||||
// center by default.
|
// center by default.
|
||||||
|
@ -144,7 +144,7 @@ func (o Content) getManifest() []tag {
|
|||||||
var imageTags, pageTags, spaceTags []tag
|
var imageTags, pageTags, spaceTags []tag
|
||||||
addTag := func(img epubimage.EPUBImage, withSpace bool) {
|
addTag := func(img epubimage.EPUBImage, withSpace bool) {
|
||||||
imageTags = append(imageTags,
|
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,
|
pageTags = append(pageTags,
|
||||||
tag{"item", tagAttrs{"id": img.PageKey(), "href": img.PagePath(), "media-type": "application/xhtml+xml"}, ""},
|
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"`
|
Format string `yaml:"format" json:"format"`
|
||||||
AppleBookCompatibility bool `yaml:"apple_book_compatibility" json:"apple_book_compatibility"`
|
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