EPUBCheck RSC-009: fragment on a raster image
Updated:
EPUBCheck RSC-009 is a warning message: “A non-SVG image resource should not be defined with a fragment identifier.” A reference to a raster image (JPEG, PNG, GIF, WebP) includes a fragment identifier (#part), which only makes sense for SVG images. Reading apps ignore or mishandle the fragment, so the image may not show as intended.
The official message
A non-SVG image resource should not be defined with a fragment identifier.
- Default severity
- Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
- EPUBCheck version
- 5.4.0
Typical causes
- A URL such as images/map.png#region copied from a web page or an image map.
- A tool that adds fragments to every image reference.
How to fix it
- Find the image reference named in the message.
- Remove the #fragment from the reference to the image.
- If you need to show part of an image, crop it into its own file or use SVG.
When it's not this
A fragment that points to an id that does not exist in an XHTML document is RSC-012.
Terms used here
Other RSC messages
RSC-008Referenced resource "…" is not declared in the OPF manifest.RSC-010Reference to non-standard resource type found.RSC-007Referenced resource "…" could not be found in the EPUB.RSC-011Found a reference to a resource that is not a spine item.RSC-006Remote resource reference is not allowed in this context; resource "…" must be located in the EPUB container.RSC-006bResource "…" is located outside the EPUB Container; please check the resource is retrieved in scripted content.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.