Package org.dspace.app.mediafilter
Class ImageMagickThumbnailFilter
- java.lang.Object
-
- org.dspace.app.mediafilter.MediaFilter
-
- org.dspace.app.mediafilter.ImageMagickThumbnailFilter
-
- All Implemented Interfaces:
FormatFilter
- Direct Known Subclasses:
ImageMagickImageThumbnailFilter,ImageMagickPdfThumbnailFilter
public abstract class ImageMagickThumbnailFilter extends MediaFilter
Filter image bitstreams, scaling the image to be within the bounds of thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be no bigger than. Creates only JPEGs.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ConfigurationServiceconfigurationServiceprotected ItemServiceitemServiceprotected static StringPRE
-
Constructor Summary
Constructors Constructor Description ImageMagickThumbnailFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBundleName()StringgetDescription()StringgetFilteredName(String oldFilename)Get a filename for a newly created filtered bitstreamStringgetFormatString()FilegetImageFile(File f, int page, boolean verbose)FilegetThumbnailFile(File f, boolean verbose)FileinputStreamToTempFile(InputStream source, String prefix, String suffix)booleanpreProcessBitstream(Context c, Item item, Bitstream source, boolean verbose)Perform any pre-processing of the source bitstream *before* the actual filtering takes place in MediaFilterManager.processBitstream().-
Methods inherited from class org.dspace.app.mediafilter.MediaFilter
postProcessBitstream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.app.mediafilter.FormatFilter
getDestinationStream
-
-
-
-
Field Detail
-
itemService
protected final ItemService itemService
-
configurationService
protected static final ConfigurationService configurationService
-
PRE
protected static final String PRE
-
-
Method Detail
-
getFilteredName
public String getFilteredName(String oldFilename)
Description copied from interface:FormatFilterGet a filename for a newly created filtered bitstream- Parameters:
oldFilename- name of source bitstream- Returns:
- filename generated by the filter - for example, document.pdf becomes document.pdf.txt
-
getBundleName
public String getBundleName()
- Returns:
- String bundle name
-
getFormatString
public String getFormatString()
- Returns:
- String bitstreamformat
-
getDescription
public String getDescription()
- Returns:
- String bitstreamDescription
-
inputStreamToTempFile
public File inputStreamToTempFile(InputStream source, String prefix, String suffix) throws IOException
- Throws:
IOException
-
getThumbnailFile
public File getThumbnailFile(File f, boolean verbose) throws IOException, InterruptedException, org.im4java.core.IM4JavaException
- Throws:
IOExceptionInterruptedExceptionorg.im4java.core.IM4JavaException
-
getImageFile
public File getImageFile(File f, int page, boolean verbose) throws IOException, InterruptedException, org.im4java.core.IM4JavaException
- Throws:
IOExceptionInterruptedExceptionorg.im4java.core.IM4JavaException
-
preProcessBitstream
public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) throws Exception
Description copied from class:MediaFilterPerform any pre-processing of the source bitstream *before* the actual filtering takes place in MediaFilterManager.processBitstream().Return true if pre-processing is successful (or no pre-processing is necessary). Return false if bitstream should be skipped for any reason.
- Specified by:
preProcessBitstreamin interfaceFormatFilter- Overrides:
preProcessBitstreamin classMediaFilter- Parameters:
c- contextitem- item containing bitstream to processsource- source bitstream to be processedverbose- verbose mode- Returns:
- true if bitstream processing should continue, false if this bitstream should be skipped
- Throws:
Exception- if error
-
-