Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
package-helpers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Philipe Gil
package-helpers
Commits
b9d9d06f
Commit
b9d9d06f
authored
10 years ago
by
Santiago Rodriguez
Browse files
Options
Downloads
Patches
Plain Diff
fop: replace non-free sRGB color profile
parent
45758271
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
helpers/DATA/fop/replace-sRGB-profile.patch
+44
-0
44 additions, 0 deletions
helpers/DATA/fop/replace-sRGB-profile.patch
helpers/make-fop
+35
-0
35 additions, 0 deletions
helpers/make-fop
with
79 additions
and
0 deletions
helpers/DATA/fop/replace-sRGB-profile.patch
0 → 100644
+
44
−
0
View file @
b9d9d06f
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);
}
This diff is collapsed.
Click to expand it.
helpers/make-fop
0 → 100644
+
35
−
0
View file @
b9d9d06f
#!/bin/sh
#
# Copyright (C) 2015 Santiago Rodríguez <santi@trisquel.info>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION
=
1
QUILT
=
skip
.
./config
#Patch original url:
# http://anonscm.debian.org/viewvc/pkg-java/trunk/fop/debian/patches/series?view=markup&pathrev=18588
cp
$DATA
/replace-sRGB-profile.patch debian/patches/
echo
replace-sRGB-profile.patch
>>
debian/patches/series
export
QUILT_PATCHES
=
debian/patches
quilt push
-a
changelog
"Use a free sRGB icc profile"
compile
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment