Blame SOURCES/fop-Use-sRGB.icc-color-profile-from-icc-profiles-openicc.patch

3a08a6
From 275f22df6791135dde308f76cf4b2f7ec30f1840 Mon Sep 17 00:00:00 2001
3a08a6
From: Michal Srb <msrb@redhat.com>
3a08a6
Date: Fri, 12 Apr 2013 15:43:11 +0200
3a08a6
Subject: [PATCH] Use sRGB.icc color profile from icc-profiles-openicc package
3a08a6
3a08a6
It's a replacement for non-free color profile shipped with fop
3a08a6
---
3a08a6
 src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java | 9 ++++++++-
3a08a6
 1 file changed, 8 insertions(+), 1 deletion(-)
3a08a6
3a08a6
diff --git a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
3a08a6
index 60fea88..e041344 100644
3a08a6
--- a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
3a08a6
+++ b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
3a08a6
@@ -21,8 +21,10 @@ package org.apache.fop.pdf;
3a08a6
 
3a08a6
 import java.awt.color.ColorSpace;
3a08a6
 import java.awt.color.ICC_Profile;
3a08a6
+import java.io.FileNotFoundException;
3a08a6
 import java.io.IOException;
3a08a6
 import java.io.InputStream;
3a08a6
+import java.io.FileInputStream;
3a08a6
 
3a08a6
 import org.apache.commons.io.IOUtils;
3a08a6
 
3a08a6
@@ -137,7 +139,12 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace {
3a08a6
     public static PDFICCStream setupsRGBColorProfile(PDFDocument pdfDoc) {
3a08a6
         ICC_Profile profile;
3a08a6
         PDFICCStream sRGBProfile = pdfDoc.getFactory().makePDFICCStream();
3a08a6
-        InputStream in = PDFDocument.class.getResourceAsStream("sRGB Color Space Profile.icm");
3a08a6
+        InputStream in;
3a08a6
+        try {
3a08a6
+            in = new FileInputStream("/usr/share/color/icc/OpenICC/sRGB.icc");
3a08a6
+        } catch (FileNotFoundException e) {
3a08a6
+            in = null;
3a08a6
+        }
3a08a6
         if (in != null) {
3a08a6
             try {
3a08a6
                 profile = ColorProfileUtil.getICC_Profile(in);
3a08a6
-- 
3a08a6
1.8.1.4
3a08a6