Skip to content

Commit

Permalink
Fixed issue with invalid ICC profiles introuced in PDFBOX-1893
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1570380 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jahewson committed Feb 20, 2014
1 parent c8a48f3 commit 8b2585a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,16 @@ private void loadICCProfile() throws IOException
initialColor = new PDColor(initial);

// create a color in order to trigger a ProfileDataException
// or CMMException due to invalid profiles, see PDFBOX-1295
// or CMMException due to invalid profiles, see PDFBOX-1295 and PDFBOX-1740
new Color(awtColorSpace, new float[getNumberOfComponents()], 1f);
}
catch (RuntimeException e)
{
if (e instanceof ProfileDataException || e instanceof CMMException)
{
// fall back to alternateColorSpace color space
LOG.debug("Can't read ICC-profile, using alternate color space");
LOG.error("Can't read embedded ICC profile, using alternate color space");
awtColorSpace = null;
alternateColorSpace = getAlternateColorSpaces().get(0);
initialColor = alternateColorSpace.getInitialColor();
}
Expand Down

0 comments on commit 8b2585a

Please sign in to comment.