pdfTeX cannot handle JPEG2000 images, but LuaTeX can.
For LuaTeX pdftex.def
can be extended to support .jp2
as file extension for JPEG2000 files:
Workaround:
\usepackage{graphicx}
\usepackage{ifluatex}
\ifluatex
\usepackage{ifpdf}
\ifpdf
\expandafter\ifx\csname Gin@rule@.jp2\endcsname\relax
\DeclareGraphicsRule{.jp2}{jpg}{.jp2}{#1}
\DeclareGraphicsRule{.JP2}{jpg}{.JP2}{#1}
\usepackage{grfext}
\AppendGraphicsExtensions{.jp2,.JP2}
\fi
\fi
\fi
This adds a rule for .jp2
(and the uppercase variant .JP2
) and adds the extension to the search list of the supported graphics extensions.
A small test file worked for AR9.5.5/Linux, but other PDF viewers (xpdf 3.03, ghostscript 9.05, evince 3.4.0) are not able to display the image properly.
\includegraphics{file.jp2}
? What about renaming it to.jpg
? – Werner Feb 2 '14 at 18:55.jpg
extension. Pdftex then says, "reading JPEG image failed (no JPEG header found)", which could be expected with a file in JPEG2000 format. When I include the file by\includegraphics{file.jb2}
, i.e., with the explicit extension, I get "readfilehdr(): reading JBIG2 image file failed: ID string missing". Could this mean there is something wrong with my file? If it means anything, Irfanview recognizes the format and displays the file correctly. – AgoraPD Feb 2 '14 at 20:03