ICEpdf
  1. ICEpdf
  2. PDF-332

JPEGCodec has been removed from JDK 1.7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.2
    • Fix Version/s: 5.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      JDK 1.7, 1.8 or Open JDK

      Description

      We've been using com.sun.image.codec.jpeg.JPEGCodec do do some funky JPEG image detection/loading since the 1.x days. The day has finally come where Oracle has removed the class which has always been a concern for a com.sun package.

      It would be fairly easy to rewrite the JPEGCodec code with something in ImageIO or JAI. ImageIO wasn't always a possibility for us as we used to be JDK 1.3 compliant. There are also some older image libraries like http://java.sun.com/products/jimi/ and http://incubator.apache.org/sanselan/site/index.html that may offer a similar feature set.

        Activity

        Patrick Corless created issue -
        Hide
        Patrick Corless added a comment -

        The library appear to be in release 1.7.0_02 of the Oracle JDK on Windows, so I'm not sure where it went in the pre-release versions. An alternative still needs to be found for people using OpenJDK. Right now I'm think we should use reflection to look for the sun API and provide some fall back code for either ImageIO or Apache Sanselan.

        Show
        Patrick Corless added a comment - The library appear to be in release 1.7.0_02 of the Oracle JDK on Windows, so I'm not sure where it went in the pre-release versions. An alternative still needs to be found for people using OpenJDK. Right now I'm think we should use reflection to look for the sun API and provide some fall back code for either ImageIO or Apache Sanselan.
        Patrick Corless made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 5.0 [ 10314 ]
        Fix Version/s 4.3 [ 10266 ]
        Hide
        Patrick Corless added a comment -

        Some notes for http://www.icefaces.org/JForum/posts/list/19871.page
        I have a windows setup very similar to above with regards to the ant and java version and could reproduce the error reported.

        So I dug around a bit to try and figure out the problem. The missing classes in question are in the %JAVA_HOME%\jre\lib\rt.jar. So the question is why isn't ant or javac not picking up on the needed classes.

        I ran a >ant -verbose clean build.jars > log.txt

        In the logs shows that %JAVA_HOME%\jre\lib\rt.jar is on the classpath but afterwards there is a statement.

        [javac] Using modern compiler
        dropping C:\java\java\jdk1.7.0_02\jre\jre\lib\rt.jar from path as it doesn't exist

        So I can't tell if this is an ant issue or a JDK issue but if I make sure the path above exists then everything compiles as expected (notice the .\jre\jre\ path).

        If you are running on a 1.7 system then you might want to updated ./examples/etc/build-common.xml 's <javac /> statement to look as follows:

        I have to do some testing still with openJDK to see if its a similar problem.

        Show
        Patrick Corless added a comment - Some notes for http://www.icefaces.org/JForum/posts/list/19871.page I have a windows setup very similar to above with regards to the ant and java version and could reproduce the error reported. So I dug around a bit to try and figure out the problem. The missing classes in question are in the %JAVA_HOME%\jre\lib\rt.jar. So the question is why isn't ant or javac not picking up on the needed classes. I ran a >ant -verbose clean build.jars > log.txt In the logs shows that %JAVA_HOME%\jre\lib\rt.jar is on the classpath but afterwards there is a statement. [javac] Using modern compiler dropping C:\java\java\jdk1.7.0_02\jre\jre\lib\rt.jar from path as it doesn't exist So I can't tell if this is an ant issue or a JDK issue but if I make sure the path above exists then everything compiles as expected (notice the .\jre\jre\ path). If you are running on a 1.7 system then you might want to updated ./examples/etc/build-common.xml 's <javac /> statement to look as follows: I have to do some testing still with openJDK to see if its a similar problem.
        Evgheni Sadovoi made changes -
        Salesforce Case [5007000000LEnki]
        Patrick Corless made changes -
        Fix Version/s 5.0.1 [ 10872 ]
        Fix Version/s 5.0 [ 10314 ]
        Patrick Corless made changes -
        Fix Version/s 5.1 [ 10675 ]
        Fix Version/s 5.0.1 [ 10872 ]
        Hide
        Andrea Vacondio added a comment -

        We have been hit by this issue, please have a look here: https://github.com/torakiki/sejda/issues/125

        Show
        Andrea Vacondio added a comment - We have been hit by this issue, please have a look here: https://github.com/torakiki/sejda/issues/125
        Hide
        Patrick Corless added a comment -
        Show
        Patrick Corless added a comment - MOre comments on the forum, http://www.icesoft.org/JForum/posts/list/0/22297.page#78251
        Hide
        Ryan Moore added a comment -

        I would suggest that in addition to targeting Java 7 that Java 8 should also be a target for this fix.

        Show
        Ryan Moore added a comment - I would suggest that in addition to targeting Java 7 that Java 8 should also be a target for this fix.
        Patrick Corless made changes -
        Environment JDK 1.7 or Open JDK JDK 1.7, 1.8 or Open JDK
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42074 Wed Aug 06 10:34:52 MDT 2014 patrick.corless PDF-332 removal of dependencies on com.sun.image.code.jpeg.JPEGCodec and addition of futher handling of ICC color profiles for CYMK to RGB and improved colour accuracy.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/DeviceCMYK.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/res/CoatedFOGRA27.icc
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Commit graph DEL /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/res/UncoatedFOGRA29.icc
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Arran Mccullough made changes -
        Support Case References Support Case #12663 - https://icesoft.my.salesforce.com/5007000000ZwVJy
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42087 Mon Aug 11 13:58:42 MDT 2014 patrick.corless PDF-332 futher refactoring related to the removal of older sun library for jpeg loading. Fixed decode ordering issue.
        Files Changed
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCbCrARasterOp.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/PColorSpaceRasterOp.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/DecodeRasterOp.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCbCrRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCCKRasterOp.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/GrayRasterOp.java
        Commit graph ADD /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/CMYKRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/SmoothScaledImageReference.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42088 Mon Aug 11 14:07:49 MDT 2014 patrick.corless PDF-332 fixed compile issue with new RasterOps.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCbCrARasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/PColorSpaceRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/DecodeRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCbCrRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/YCCKRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/GrayRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/CMYKRasterOp.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42092 Tue Aug 12 09:45:49 MDT 2014 patrick.corless PDF-332 fixed some issue with gray decoding.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/PColorSpaceRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/RasterOps/DecodeRasterOp.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42093 Tue Aug 12 10:59:45 MDT 2014 patrick.corless PDF-332 correction of function 0 sample size.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/functions/Function_0.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42094 Tue Aug 12 14:41:29 MDT 2014 patrick.corless PDF-332 fixed an issue when Separation colour space is applied to a jpg2000 images.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Hide
        Patrick Corless added a comment -

        Marking as fixed. QA has passed with no regressions and in genneral many improvements in the quality of the conversions.

        Show
        Patrick Corless added a comment - Marking as fixed. QA has passed with no regressions and in genneral many improvements in the quality of the conversions.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42107 Thu Aug 14 08:06:07 MDT 2014 patrick.corless PDF-332 futher consolidation of common mask handling.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42110 Thu Aug 14 10:15:43 MDT 2014 patrick.corless PDF-332 reworked some alpha applications for building raw images to fix some transparency regressions.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42113 Thu Aug 14 12:50:40 MDT 2014 patrick.corless PDF-332 removed DeviceCMYK from makeImageWithRasterFromBytes() as is quite a bit slower then building the raster in parseImage().
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageUtility.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42127 Wed Aug 20 12:05:39 MDT 2014 patrick.corless PDF-332 fixed an issue with JAI native clib's not getting rasters correctly.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42128 Wed Aug 20 12:06:55 MDT 2014 patrick.corless PDF-332 fix for deadlock issue on JDK 1.5
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/viewer/src/org/icepdf/ri/common/views/PageViewComponentImpl.java
        Hide
        Patrick Corless added a comment -

        A bunch of small fixes have gone into this in the last few days and I'm feeling the imaging is once again stable. One of the last major issue was related to the installation of the JAI on a particular JDK. When installed the following native ImageReaders are installed.

        com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib
        com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReade

        The problem with these readers is that they can't handle getting the image as a raster. The good news is that a call to canReadRaster() can test for and ignore these readers.

        One of the cool side effects of moving to an more or less pure ImageIO implementation is that other JPEG deocders can be used. This should be useful for the Linux crowd. In my testing the twelvemonkeys API worked very well added to the class path. The following jars are required.

        twelvemonkeys-common-image-3.0.jar
        twelvemonkeys-common-io-3.0.jar
        twelvemonkeys-common-lang-3.0.jar
        twelvemonkeys-common-core3.0.jar
        twelvemonkeys-common-jpeg-3.0.jar
        twelvemonkeys-common-metadata-3.0.jar

        Show
        Patrick Corless added a comment - A bunch of small fixes have gone into this in the last few days and I'm feeling the imaging is once again stable. One of the last major issue was related to the installation of the JAI on a particular JDK. When installed the following native ImageReaders are installed. com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReade The problem with these readers is that they can't handle getting the image as a raster. The good news is that a call to canReadRaster() can test for and ignore these readers. One of the cool side effects of moving to an more or less pure ImageIO implementation is that other JPEG deocders can be used. This should be useful for the Linux crowd. In my testing the twelvemonkeys API worked very well added to the class path. The following jars are required. twelvemonkeys-common-image-3.0.jar twelvemonkeys-common-io-3.0.jar twelvemonkeys-common-lang-3.0.jar twelvemonkeys-common-core3.0.jar twelvemonkeys-common-jpeg-3.0.jar twelvemonkeys-common-metadata-3.0.jar
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42570 Tue Sep 16 15:12:37 MDT 2014 patrick.corless PDF-332 fixed last case senario for DCT images with color band.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/ImageStream.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #42576 Wed Sep 17 13:17:17 MDT 2014 patrick.corless PDF-332 getIccCmykColorSpace() now returns a new instance of the ICC_Profile to get around JDK-8033238.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-5.0.1/icepdf/core/src/org/icepdf/core/pobjects/graphics/DeviceCMYK.java
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: