mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
Merge pull request #8553 from alanorth/imagemagick-pdf-density
dspace-api: allow overriding ImageMagick density
This commit is contained in:
@@ -119,6 +119,19 @@ public abstract class ImageMagickThumbnailFilter extends MediaFilter {
|
|||||||
f2.deleteOnExit();
|
f2.deleteOnExit();
|
||||||
ConvertCmd cmd = new ConvertCmd();
|
ConvertCmd cmd = new ConvertCmd();
|
||||||
IMOperation op = new IMOperation();
|
IMOperation op = new IMOperation();
|
||||||
|
|
||||||
|
// Optionally override ImageMagick's default density of 72 DPI to use a
|
||||||
|
// "supersample" when creating the PDF thumbnail. Note that I prefer to
|
||||||
|
// use the getProperty() method here instead of getIntPropert() because
|
||||||
|
// the latter always returns an integer (0 in the case it's not set). I
|
||||||
|
// would prefer to keep ImageMagick's default to itself rather than for
|
||||||
|
// us to set one. Also note that the density option *must* come before
|
||||||
|
// we open the input file.
|
||||||
|
String density = configurationService.getProperty(PRE + ".density");
|
||||||
|
if (density != null) {
|
||||||
|
op.density(Integer.valueOf(density));
|
||||||
|
}
|
||||||
|
|
||||||
String s = "[" + page + "]";
|
String s = "[" + page + "]";
|
||||||
op.addImage(f.getAbsolutePath() + s);
|
op.addImage(f.getAbsolutePath() + s);
|
||||||
if (configurationService.getBooleanProperty(PRE + ".flatten", true)) {
|
if (configurationService.getBooleanProperty(PRE + ".flatten", true)) {
|
||||||
|
@@ -547,6 +547,12 @@ filter.org.dspace.app.mediafilter.PDFBoxThumbnail.inputFormats = Adobe PDF
|
|||||||
# org.dspace.app.mediafilter.ImageMagickThumbnailFilter.cmyk_profile = /usr/share/ghostscript/9.18/iccprofiles/default_cmyk.icc
|
# org.dspace.app.mediafilter.ImageMagickThumbnailFilter.cmyk_profile = /usr/share/ghostscript/9.18/iccprofiles/default_cmyk.icc
|
||||||
# org.dspace.app.mediafilter.ImageMagickThumbnailFilter.srgb_profile = /usr/share/ghostscript/9.18/iccprofiles/default_rgb.icc
|
# org.dspace.app.mediafilter.ImageMagickThumbnailFilter.srgb_profile = /usr/share/ghostscript/9.18/iccprofiles/default_rgb.icc
|
||||||
|
|
||||||
|
# Optional: override ImageMagick's default density of 72 when creating PDF thum-
|
||||||
|
# bnails. Greatly increases quality of resulting thumbnails, at the expense of
|
||||||
|
# slightly longer execution times and higher memory usage. Any integer over 72
|
||||||
|
# will help, but recommend 144 for a "2x" supersample.
|
||||||
|
# org.dspace.app.mediafilter.ImageMagickThumbnailFilter.density = 144
|
||||||
|
|
||||||
#### Crosswalk and Packager Plugin Settings ####
|
#### Crosswalk and Packager Plugin Settings ####
|
||||||
# Crosswalks are used to translate external metadata formats into DSpace's internal format (DIM)
|
# Crosswalks are used to translate external metadata formats into DSpace's internal format (DIM)
|
||||||
# Packagers are used to ingest/export 'packages' (both content files and metadata)
|
# Packagers are used to ingest/export 'packages' (both content files and metadata)
|
||||||
|
Reference in New Issue
Block a user