Save images in GIF when output is set to MOBI and forcepng is used (#981)

* Save images in GIF when output is set to MOBI and forcepng option is used

* Save images in GIF when output is set to EPUB, kindle profile is used and forcepng option is set

* media-type="image/gif"

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
This commit is contained in:
Adrian
2025-06-24 22:14:00 -07:00
committed by GitHub
co-authored by Alex Xu
parent 2ecbf7d2e9
commit 217a18b7b5
2 changed files with 8 additions and 2 deletions
+2
View File
@@ -336,6 +336,8 @@ def buildOPF(dstdir, title, filelist, cover=None):
".xhtml\" media-type=\"application/xhtml+xml\"/>\n")
if '.png' == filename[1]:
mt = 'image/png'
elif '.gif' == filename[1]:
mt = 'image/gif'
else:
mt = 'image/jpeg'
f.write("<item id=\"img_" + str(uniqueid) + "\" href=\"" + folder + "/" + path[1] + "\" media-type=\"" +