Audit EPUB Cover Metadata With a Small Python Script
When an EPUB shows its cover in Apple Books or Calibre but arrives on a Kindle as a grey tile, the image is usually fine. What is broken is the metadata that tells a converter which image is the cover. You can check it yourself with a short, standard-library Python script that reads container.xml , finds the OPF, and compares the EPUB 3 cover-image property, the EPUB 2 <meta name="cover">…
Cover metadata in an EPUB file can be checked using a small Python script. The script reads the container.xml, finds the OPF package file, and compares various elements related to the cover image. Key points include the EPUB being a ZIP file, metadata declarations for EPUB 3 and EPUB 2, and the need for all declarations to point to the same item with the correct media type. An EPUB cover can show as a cover in one app but appear as a grey tile on Kindle due to missing or incorrect metadata.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to