Examples of ICC_Profile


Examples of java.awt.color.ICC_Profile

        return iccProf;
    }

    private ICC_Profile tryToExctractICCProfileFromPNGMetadataNode(
            Element pngNode) {
        ICC_Profile iccProf = null;
        Element iccpNode = ImageIOUtil.getChild(pngNode, "iCCP");
        if (iccpNode instanceof IIOMetadataNode) {
            IIOMetadataNode imn = (IIOMetadataNode) iccpNode;
            byte[] prof = (byte[]) imn.getUserObject();
            String comp = imn.getAttribute("compressionMethod");
View Full Code Here

Examples of java.awt.color.ICC_Profile

        return iccProf;
    }

    private ICC_Profile tryToExctractICCProfileFromJPEGMetadataNode(
            Element jpgNode) {
        ICC_Profile iccProf = null;
        Element jfifNode = ImageIOUtil.getChild(jpgNode, "app0JFIF");
        if (jfifNode != null) {
            Element app2iccNode = ImageIOUtil.getChild(jfifNode, "app2ICC");
            if (app2iccNode instanceof IIOMetadataNode) {
                IIOMetadataNode imn = (IIOMetadataNode) app2iccNode;
View Full Code Here

Examples of java.awt.color.ICC_Profile

     */
    public ColorSpace get(String base, String iccProfileSrc) {
        ColorSpace colorSpace = null;
        if (!colorSpaceMap.containsKey(base + iccProfileSrc)) {
            try {
                ICC_Profile iccProfile = null;
                // First attempt to use the FOP URI resolver to locate the ICC
                // profile
                Source src = resolver.resolve(iccProfileSrc, base);
                if (src != null && src instanceof StreamSource) {
                    // FOP URI resolver found ICC profile - create ICC profile
View Full Code Here

Examples of java.awt.color.ICC_Profile

     * @param profile the color profile to check
     * @return true if it is the default sRGB profile
     */
    public static boolean isDefaultsRGB(ICC_Profile profile) {
        ColorSpace sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
        ICC_Profile sRGBProfile = null;
        if (sRGB instanceof ICC_ColorSpace) {
            sRGBProfile = ((ICC_ColorSpace)sRGB).getProfile();
        }
        return profile == sRGBProfile;
    }
View Full Code Here

Examples of java.awt.color.ICC_Profile

    // We cant use Sanselan to read JPEG but we can use it to read all the metadata which is
    // where most security issues reside anyway in ImageIO
    Sanselan.getMetadata(bytes, null);
    byte[] iccBytes = Sanselan.getICCProfileBytes(bytes);
    if (iccBytes != null && iccBytes.length > 0) {
      ICC_Profile iccProfile = Sanselan.getICCProfile(bytes, null);
      if (iccProfile == null) {
        throw new ImageReadException("Image has ICC but it is corrupt and cannot be read");
      }
    }
    return ImageIO.read(new ByteArrayInputStream(bytes));
View Full Code Here

Examples of java.awt.color.ICC_Profile

            return null;

        // Now that we have a profile element,
        // try to load the corresponding ICC profile xlink:href
        String href = XLinkSupport.getXLinkHref(profile);
        ICC_Profile p = null;
        if (href != null) {
            String baseURI= ((SVGOMDocument)doc).getURL();
            ParsedURL purl = new ParsedURL(baseURI, href);
            if (!purl.complete())
                throw new BridgeException(paintedElement, ERR_URI_MALFORMED,
View Full Code Here

Examples of java.awt.color.ICC_Profile

            return null;

        // Now that we have a profile element,
        // try to load the corresponding ICC profile xlink:href
        String href = XLinkSupport.getXLinkHref(profile);
        ICC_Profile p = null;
        if (href != null) {
            String baseURI= ((SVGOMDocument)doc).getURL();
            ParsedURL purl = new ParsedURL(baseURI, href);
            if (!purl.complete())
                throw new BridgeException(paintedElement, ERR_URI_MALFORMED,
View Full Code Here

Examples of java.awt.color.ICC_Profile

    protected void processICCBasedColorSpace(PDColorSpace pdcs)
    {
        PDICCBased iccBased = (PDICCBased) pdcs;
        try
        {
            ICC_Profile iccp = ICC_Profile.getInstance(iccBased.getPDStream().getByteArray());
            if (iccp == null)
            {
                context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_ICCBASED,
                        "Unable to read ICCBase color space "));
                return;
View Full Code Here

Examples of java.awt.color.ICC_Profile

                {
                    PDStream stream = PDStream.createFromCOS(COSUtils.getAsStream(destOutputProfile,
                            document.getDocument()));
                    if (stream != null)
                    {
                        ICC_Profile iccp = ICC_Profile.getInstance(stream.getByteArray());
                        return new ICCProfileWrapper(iccp);
                    }
                }
                catch (IllegalArgumentException e)
                {
View Full Code Here

Examples of java.awt.color.ICC_Profile

                addValidationError(ctx, new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY,
                        "OutputIntent object uses a NULL Object"));
                return;
            }

            ICC_Profile iccp = ICC_Profile.getInstance(stream.getByteArray());
            PreflightConfiguration config = ctx.getConfig();
            // check the ICC Profile version (6.2.2)
            if (iccp.getMajorVersion() == 2)
            {
                if (iccp.getMinorVersion() > 0x40)
                {
                    // in PDF 1.4, max version is 02h.40h (meaning V 3.5)
                    // see the ICCProfile specification (ICC.1:1998-09)page 13 - §6.1.3 :
                    // The current profile version number is "2.4.0" (encoded as 02400000h")
                    ValidationError error = new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_TOO_RECENT,
                            "Invalid version of the ICCProfile");
                    error.setWarning(config.isLazyValidation());
                    addValidationError(ctx, error);
                    return;
                } // else OK
            }
            else if (iccp.getMajorVersion() > 2)
            {
                // in PDF 1.4, max version is 02h.40h (meaning V 3.5)
                // see the ICCProfile specification (ICC.1:1998-09)page 13 - §6.1.3 :
                // The current profile version number is "2.4.0" (encoded as 02400000h"
                ValidationError error = new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_TOO_RECENT,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.