FB2 - Cover Embedded as a base64 binary Element
A FictionBook whose cover is a base64-encoded PNG in a binary element at the foot of the file, wired to a coverpage in the description by xlink id. For testing FB2 image extraction and the converters that have to turn that blob back into a real file.
<?xml version="1.0" encoding="UTF-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">
<description>
<title-info>
<genre>sci_philosophy</genre>
<author><first-name>Ilse</first-name><last-name>Brandt-Nakamura</last-name></author>
<book-title>A FictionBook With Its Cover Inside It</book-title>
<coverpage><image l:href="#cover.png"/></coverpage>
<lang>en</lang>
</title-info>
<document-info>
<author><nickname>novus</nickname></author>
<date value="2026-08-07">2026</date>
<id>novus-p7-fb2-cover</id>
<version>1.0</version>
</document-info>
</description>
<body>
<title><p>A FictionBook With Its Cover Inside It</p></title>
<section><title><p>One. The Blob at the Bottom</p></title><p>FictionBook has no container, so an image has to live inside the XML itself: base64 in a binary element at the end of the file, referenced by id from a coverpage element in the description.</p><p>That makes the cover unavoidable for a parser - it must decode the whole document to reach it - and it makes the file grow by a third of the image's real size.</p></section>
</body>
<binary id="cover.png" content-type="image/png">
iVBORw0KGgoAAAANSUhEUgAAAJYAAADICAIAAACF548yAAABaklEQVR42u3RQQkAIBAAQVuYwEY2
sLkvwY8RDCGCJwObYCf1sRS6ZAFCIRRChC4gFEJdIcyl6qkQIhRCIUSIEKEQCiFChAiFUAgRIkQo
hEKIECFCIRRChAgRCqEQIkSIUAiFECFChEIohAgRIhRCIUSIEKEQCiFChAiFUAgRIkQohEKIECFC
IRRChAgRCqEQIkSIUAiFECFChEIohAgRIhRCIUSIEKEQCiFChAiFUAgRIkQohEKIECFCIRRChAgR
CqEQIkSIUAiFECFChEIohAgRIhRCIUToGkIhFEKEQiiEQohQCIVQCBEKoRAKIUIhFEIhRCiEQiiE
CIVQCIUQoRAKIUKECIVQCBEiRCiEQogQIUJFIixt6qkQIhRCIUSIEKEQCiFChAiFUAgRIkQohEKI
ECFCIRRChAgRCqEQIkSIUAiFECFChEIohAgRIhRCIUSIEKEQCiFChH8TKkoIEQqhECJ0AaEQ6qgN
daid05y4/GEAAAAASUVORK5CYII=
</binary>
</FictionBook>
Specifications
- Seed
- 20260807
- Format
- FictionBook 2.0
- Encoding
- UTF-8
- Coverpage
- true
- Binary Elements
- 1
- Binary Content Type
- image/png
- Image Size
- 150x200
- Base64 Line Length
- 76
- Line Endings
- LF
Testing contract
Expected to pass- Scenario
- Extract the cover image and convert the book to EPUB.
- Expected result
- The binary element decodes to a valid 150x200 PNG, and conversion writes it out as a real image file referenced from the EPUB manifest rather than dropping the cover.
What is a .fb2 file?
FB2 (FictionBook) is an XML-based e-book format that stores an entire book, including metadata and embedded images, in a single well-structured XML file. It emphasizes semantic markup of book structure over fixed presentation. It is especially popular in the Russian-speaking e-book community.
How to use this file
Use an example FB2 to test XML e-book parsing, embedded-image extraction, metadata handling, and converters between FB2 and EPUB.
How to use this file for testing
“FB2 - Cover Embedded as a base64 binary Element” is a deterministic Novus Examples fixture for Conversion testing, Metadata testing. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.
Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
E-book fixtures are structured archives documented down to their spine and manifest. Test readers and converters, and where a valid↔intentionally-invalid pair exists, assert graceful handling of the malformed container.
Related files
- azwConvert v2 DRM-Free AZW E-bookDRM-free AZW/MOBI7 e-book source copied byte-for-byte from the catalog's valid reader fixture for legacy import testing. Stable P8 artifact p8-convert-legacy-azw.

- cbrConvert v2 Two-Page CBR ComicValid CBR comic container with two deterministic PNG pages in lexical reading order for legacy comic conversion. Stable P8 artifact p8-convert-legacy-cbr.

- epubEPUB 2.0.1 - Cover by meta name="cover" Only (no guide, no cover page)The cover convention that predates every standard way of doing it: a bare meta name="cover" pointing at a manifest id, with no guide reference, no cover XHTML page and nothing in the spine. For testing cover extraction against the messiest of the three EPUB 2 conventions.

- epubEPUB 3 - Metadata Refines Chains (title-type, file-as, collection)Two dc:title elements distinguished only by refines chains into title-type and display-seq, a creator with file-as and a MARC relator role, and a series declared with belongs-to-collection. The structure a catalogue actually needs, and the one flat metadata readers collapse into a single confused string.

- txtConvert v2 Archive SHA-256 ListGNU-style SHA-256 list for the two canonical TAR members, preserving relative paths and full lowercase digests. Stable P8 artifact p8-convert-archive-sha256.

- jsonCycloneDX Container Image SBOMA CycloneDX SBOM whose root component is an OCI container image rather than an application, mixing a fictional operating-system package with language packages — the shape an image scanner emits. Every package, version, hash and licence is fictional — the tree describes nothing real.

Generated by generation/ebooks_p7.py. Free for any use, no attribution required — license.