title: PDFBox throws writeImage error when building on OpenJDK
body: <p>I'm building <a href="https://github.com/apache/pdfbox/commit/735e88528cba4c58ef873bf32cb2dc092c19a543" rel="nofollow">this version</a> of PDFBox on Ubuntu with this version of OpenJDK:</p>
  
  <pre>
  java version "1.7.0_65"
  OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.12.04.1)
  OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
  
  </pre>
  
  <p>I get the following exception when running the tests:</p>
  
  <p><code>
  javax.imageio.IIOException: Invalid argument to native writeImage
  </code></p>
  
  <p>Expanded:</p>
  
  <pre><code>-------------------------------------------------------------------------------
  Test set: org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest
  -------------------------------------------------------------------------------
  Tests run: 6, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.804 sec &lt;&lt;&lt; FAILURE! - in org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest
  testCreateFromImageINT_ARGB(org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest)  Time elapsed: 0.387 sec  &lt;&lt;&lt; ERROR!
  javax.imageio.IIOException: Invalid argument to native writeImage
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1058)
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:360)
          at javax.imageio.ImageWriter.write(ImageWriter.java:615)
          at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
          at javax.imageio.ImageIO.write(ImageIO.java:1578)
          at org.apache.pdfbox.pdmodel.graphics.image.ValidateXImage.validate(ValidateXImage.java:63)
          at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest.testCreateFromImageINT_ARGB(JPEGFactoryTest.java:141)
  
  testCreateFromImage4BYTE_ABGR(org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest)  Time elapsed: 0.147 sec  &lt;&lt;&lt; ERROR!
  javax.imageio.IIOException: Invalid argument to native writeImage
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1058)
          at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:360)
          at javax.imageio.ImageWriter.write(ImageWriter.java:615)
          at javax.imageio.ImageIO.doWrite(ImageIO.java:1612)
          at javax.imageio.ImageIO.write(ImageIO.java:1578)
          at org.apache.pdfbox.pdmodel.graphics.image.ValidateXImage.validate(ValidateXImage.java:63)
          at org.apache.pdfbox.pdmodel.graphics.image.JPEGFactoryTest.testCreateFromImage4BYTE_ABGR(JPEGFactoryTest.java:182)
  </code></pre>
  
  <p><a href="https://www.google.co.uk/webhp?q=site%3Amail-archives.apache.org%2Fmod_mbox%2Fpdfbox-dev%2F+%22javax.imageio.IIOException%3A+Invalid+argument+to+native+writeImage%22" rel="nofollow">Searching</a> the archives hasn't shed light.</p>