fire-eggs / DarkThumbs

Adds thumbnail preview to Windows Explorer for EPUB, FB2, DJVU and Kindle ebooks; 7Z, CB7, CBZ, CBR, RAR and ZIP archives.
451 stars 23 forks source link

Proper detection of some epub cover #4

Closed s-kocher closed 4 years ago

s-kocher commented 4 years ago

It's nice to see there is improvement of epub support since original T800 CBX Shell :) https://github.com/T800G/CBXShell/search?q=container.xml&unscoped_q=container.xml https://github.com/dark-knight404/DarkThumbs/search?q=container.xml&unscoped_q=container.xml

Before : image

After : image

Some epub have still issue to get the right cover and use the same strategy as original CBX Shell (as fallback I guess) and get the first image available : image

It's weird because container.xml and content.opf are ok : META-INF/container.xml

<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
    <rootfiles>
        <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
    </rootfiles>
</container>

OEBPS/content.opf

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="bookid" version="2.0">
    <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
        <dc:title>Kotlin for Enterprise Applications using Java EE</dc:title>
        <!-- ... -->
        <meta name="cover" content="Images/24c9fdee-a166-474a-9c44-84df76f0e730.png"/>
    </metadata>
</package>

Images/24c9fdee-a166-474a-9c44-84df76f0e730.png is available and is the right cover : image

dark-knight404 commented 4 years ago

As per this IDPF discussion....

Amazon, Barnes & Noble, and iBookstore currently require a declaration in the Metadata Section as well for cover images. We use the following meta element in our OPF file that is suggested by the vendors: <meta name="cover" content="My_Cover_ID" /> And the corresponding item element in the Manifest Section: <item href="cover.jpg" id="My_Cover_ID" media-type="image/jpeg" />

So the format used in OEBPS/content.opf of the epub file in question, is different/invalid/not supported. @L0garithmic do you agree?

L0garithmic commented 4 years ago

@s-kocher can you upload the books in question. Throw them to me for some testing with calibre checks.

@dark-knight404 I'd say you're right. Very solid reasoning. I'll experiment with the files and run some checks. But I think you're reasoning is spot on.

s-kocher commented 4 years ago

Here is the file : removed link

I let you delete it after retrieval since it's copyrighted material.

s-kocher commented 4 years ago

Thanks for IDPF discussion link regarding epub versions and impact on the cover file resolution

L0garithmic commented 4 years ago

Yeah, no offense but that ePub is pretty royally forked. ePubCheck threw something like 500+ errors. Calibre trying to convert, created the great wall of red text that went on for... forever. Literally, let it run for like 2 minutes and kept throwing errors.

If there was an actual issue. I would say we should look into it. But in this case, your file is very borked.

dark-knight404 commented 4 years ago

Thanks @s-kocher @L0garithmic for your investigation/efforts! Please confirm if we can close this issue. :)

L0garithmic commented 4 years ago

Yep. Closed