Bug#657281: fop non-free file

Emmanuel Bourg ebourg at apache.org
Sat Nov 1 23:51:35 UTC 2014


I took a look at the code, the profile is loaded in the
PDFICCBasedColorSpace class with this method:

    /**
     * Sets up the sRGB color profile in the PDF document. It does so by
trying to
     * install a very small ICC profile (~4KB) instead of the very big
one (~140KB)
     * the Sun JVM uses.
     * @param pdfDoc the PDF document
     * @return the ICC stream with the sRGB profile
     */
    public static PDFICCStream setupsRGBColorProfile(PDFDocument pdfDoc) {
        ICC_Profile profile;
        PDFICCStream sRGBProfile = pdfDoc.getFactory().makePDFICCStream();
        InputStream in = PDFDocument.class.getResourceAsStream("sRGB
Color Space Profile.icm");
        if (in != null) {
            try {
                profile = ColorProfileUtil.getICC_Profile(in);
            } catch (IOException ioe) {
                throw new RuntimeException(
                        "Unexpected IOException loading the sRGB
profile: " + ioe.getMessage());
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            // Fallback: Use the sRGB profile from the JRE (about 140KB)
            profile = ColorProfileUtil.getICC_Profile(ColorSpace.CS_sRGB);
        }
        sRGBProfile.setColorSpace(profile, null);
        return sRGBProfile;
    }


If the icm file can't be found the method falls back to the profile
provided by the JDK. This only makes the generated file slightly bigger,
but nothing breaks. So removing the file is ok.



More information about the pkg-java-maintainers mailing list