PKG-022: wrong file extension for image
Epubcheck reports: WARNING(PKG-022): Wrong file extension for image. The
image is a "jpeg" file but has the file extension "png". The bytes and the filename
disagree about the format.
What it means
Epubcheck looked inside the image and found a different format than the extension claims. This is a warning, not an error, so it will not fail validation on its own. But it points at the same underlying mixup as OPF-029, which is an error, and the two usually arrive together.
Why it happens
An image was converted from one format to another and kept its old name, or a file was renamed to a different extension in the belief that this converts it (it does not). Cover images swapped in by library tools are a frequent source.
How to fix it
- Rename the file so the extension matches the real format, then update everything that
points at it: the manifest
href, any<img src>, and CSSurl()references. - Or convert the image to the format the name claims, and touch nothing else. Fewer edits, same result.
The checker reports the affected file, and since warnings alone do not fail a book, you can decide whether it is worth the cleanup. If OPF-029 comes with it, fix that one at minimum.
Check your Epub