Merge branch 'fix-fop' into 'flidas'

Remove make-fop

The patch it applied has been included into the patch series in the
upstream package.

See merge request !182
This commit is contained in:
Ruben Rodriguez 2018-02-16 04:32:24 +00:00
commit ad5448b4e3
2 changed files with 0 additions and 79 deletions

View file

@ -1,44 +0,0 @@
Description: Load the sRGB profile from the icc-profiles-free package
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
Bug-Debian: https://bugs.debian.org/657281
Bug: https://issues.apache.org/jira/browse/FOP-2025
--- a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
+++ b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java
@@ -21,6 +21,8 @@
import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -135,11 +137,14 @@
* @return the ICC stream with the sRGB profile
*/
public static PDFICCStream setupsRGBColorProfile(PDFDocument pdfDoc) {
- ICC_Profile profile;
+ ICC_Profile profile = null;
PDFICCStream sRGBProfile = pdfDoc.getFactory().makePDFICCStream();
- InputStream in = PDFDocument.class.getResourceAsStream("sRGB Color Space Profile.icm");
- if (in != null) {
+ // Load the sRGB profile installed by the icc-profiles-free package
+ File file = new File("/usr/share/color/icc/sRGB.icc");
+ if (file.exists()) {
+ InputStream in = null;
try {
+ in = new FileInputStream(file);
profile = ColorProfileUtil.getICC_Profile(in);
} catch (IOException ioe) {
throw new RuntimeException(
@@ -147,7 +152,8 @@
} finally {
IOUtils.closeQuietly(in);
}
- } else {
+ }
+ if (profile == null) {
// Fallback: Use the sRGB profile from the JRE (about 140KB)
profile = ColorProfileUtil.getICC_Profile(ColorSpace.CS_sRGB);
}