title: Image type UNKNOWN with PDFBox and JPEG 2000 sample
body: <p>I've taken a sample <em>JPEG 2000</em> from the <a href="https://www.fnordware.com/j2k/jp2samples.html" rel="nofollow noreferrer">fnord examples page</a>.</p>
  <p>However, when I try to add that image to the PDF:</p>
  <pre><code>PDDocument document = new PDDocument();
  PDImageXObject pdImage = pdImage = PDImageXObject.createFromFileByContent(
     &quot;samples/relax.jp2&quot;, document);
  PDPage page = new PDPage(new PDRectangle(pageWidth, pageHeight));
  PDPageContentStream contentStream = new PDPageContentStream(document, page);
  contentStream.drawImage(pdImage, matrix);
  contentStream.close();
  </code></pre>
  <p>I get the exception:</p>
  <blockquote>
  <p>Caused by: java.lang.IllegalArgumentException: Image type UNKNOWN not
  supported: relax.jp2
  at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createFromFileByContent(PDImageXObject.java:313)</p>
  </blockquote>
  <p>The PDFBox dependencies that I have in Maven:</p>
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.pdfbox&lt;/groupId&gt;
          &lt;artifactId&gt;pdfbox&lt;/artifactId&gt;
          &lt;version&gt;2.0.12&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.pdfbox&lt;/groupId&gt;
          &lt;artifactId&gt;fontbox&lt;/artifactId&gt;
          &lt;version&gt;2.0.12&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.pdfbox&lt;/groupId&gt;
          &lt;artifactId&gt;jempbox&lt;/artifactId&gt;
          &lt;version&gt;1.8.16&lt;/version&gt;
      &lt;/dependency&gt;       
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.pdfbox&lt;/groupId&gt;
          &lt;artifactId&gt;jbig2-imageio&lt;/artifactId&gt;
          &lt;version&gt;3.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.jai-imageio&lt;/groupId&gt;
          &lt;artifactId&gt;jai-imageio-core&lt;/artifactId&gt;
          &lt;version&gt;1.4.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.jai-imageio&lt;/groupId&gt;
          &lt;artifactId&gt;jai-imageio-jpeg2000&lt;/artifactId&gt;
          &lt;version&gt;1.3.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  <p>Am I doing something wrong here? Or there is some problem with PDFBox and/or the samples that I'm using?</p>
  <p>Other Apache library, <a href="https://tika.apache.org/" rel="nofollow noreferrer">Tika</a>, detects this sample file MIME type as <code>image/jp2</code>:</p>
  <pre><code>TikaConfig tika = new TikaConfig();
  Metadata metadata = new Metadata();
  MediaType mimetype = tika.getDetector().detect(
       TikaInputStream.get(new FileInputStream(&quot;samples/relax.jp2&quot;), metadata);
  </code></pre>