benchen71 / epub-metadata-editor

Edit the metadata of EPUB files
194 stars 11 forks source link

Can't save a cover to an epub3 file #79

Closed LadyHaywood closed 1 year ago

LadyHaywood commented 1 year ago

When trying to add a cover I would get an error saying it can't find the file. However, when you open the file contents there is a cover image file and a coverpage xhtml file but it won't apply that cover. Moving the book over to my ereader or in calibre the cover just doesn't show at all. I've also tried using an image from the book just don't work. It'll blink but nothing would happen.

benchen71 commented 1 year ago

You'll have to attach the file, because there will probably be something else going on. If you change the extension from .epub to .jpg you will be able to attach the file here. I can then change the extension back at my end.

LadyHaywood commented 1 year ago

I'm not able to add it since it's over the 10MB limit. I've never tried compressing an epub further or an epub turned image file before so I don't know if I'm able to do that. Is there another way to send the file?

benchen71 commented 1 year ago

Email it to me. Thanks!

LadyHaywood commented 1 year ago

Sorry for the wait, I've sent an email about the file.

benchen71 commented 1 year ago

Sorry that it has taken me so long to get back to you. Essentially, as far as I can tell the problem exists with the EPUB file itself. There are two xhtml files missing, including the one that is the fallback cover page. If you open the "Advanced Tasks" panel, you can then edit the .opf file. Then in the section near the very bottom of this file it says this:

But there are no pages with either of these names in the EPUB itself, which you can also verify by clicking the "Show EPUB contents in Windows Explorer" button. The reason the other file you supplied does show a cover correctly is that the page listed as the cover is present in the EPUB.

I don't think it is possible for me to get my program to fix this issue. You would have to manually edit the EPUB file. I would suggest copying page00001.xhtml from the file that works and then editing it to match the cover filename. Then, hopefully, it will open correctly!

benchen71 commented 1 year ago

Actually, you can simply rename coverpage.xhtml to page00001.xhtml. It's in the OEBPS folder after you click the "Show EPUB contents in Windows Explorer" button. Then return to EPUB Metadata Editor and save the file. When you close and re-open it, it should work correctly.