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