[ 
https://issues.apache.org/jira/browse/PDFBOX-5751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr resolved PDFBOX-5751.
-------------------------------------
    Fix Version/s: 2.0.31
                   3.0.2 PDFBox
                   4.0.0
         Assignee: Tilman Hausherr
       Resolution: Fixed

Sorry for asking for a stack trace, I see there is none. This has now been 
fixed, although the exception still happens, but obviously it's not our fault.
{noformat}
    javax.imageio.IIOException: Not a JPEG file: starts with 0x14 0x50
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native
 Method)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(JPEGImageReader.java:746)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(JPEGImageReader.java:361)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(JPEGImageReader.java:511)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(JPEGImageReader.java:739)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1181)
        at 
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readRaster(JPEGImageReader.java:1626)
        at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:101)
{noformat}


> Convert to image exception
> --------------------------
>
>                 Key: PDFBOX-5751
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5751
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.30, 3.0.1 PDFBox
>            Reporter: liu
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.31, 3.0.2 PDFBox, 4.0.0
>
>         Attachments: 666.pdf
>
>
> {code:java}
> public static void main(String[] args) throws IOException, 
> InterruptedException {
>               File file = new File("D:\\qys\\666.pdf");
>               final PDDocument load = PDDocument.load(file, 
> MemoryUsageSetting.setupTempFileOnly()
>                               .setTempDir(new File("D:\\fcs\\test")));
>               try {
>                       PDFRenderer renderer = new PDFRenderer(load);
>                       int pageIndex = 0;
>                       float scale = 2f;
>                       BufferedImage bufferedImage = 
> renderer.renderImage(pageIndex, scale, ImageType.RGB);
>                       FileOutputStream fos = null;
>                       try {
>                               fos = new FileOutputStream(new 
> File("D:\\fcs\\test/test6/image" + pageIndex + ".jpg"));
>                               ImageIO.write(bufferedImage, "jpg", fos);
>                       } finally {
>                               if (fos != null) {
>                                       fos.close();
>                               }
>                       }
>               } catch (Throwable e){
>                       e.printStackTrace();
>               }
>               Thread.sleep(6000000);
>       }
> {code}
> java version:jdk8



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to