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,ImageMagickVideoThumbnailFilter
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
FieldsModifier and TypeFieldDescriptionprotected static final ConfigurationServiceprotected final ItemServiceprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFilteredName(String oldFilename) Get a filename for a newly created filtered bitstreamgetImageFile(File f, boolean verbose) Return an image from a bitstream with specific processing options for PDFs.getThumbnailFile(File f, boolean verbose) inputStreamToTempFile(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
postProcessBitstreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.app.mediafilter.FormatFilter
getDestinationStream
-
Field Details
-
itemService
-
configurationService
-
PRE
-
-
Constructor Details
-
ImageMagickThumbnailFilter
public ImageMagickThumbnailFilter()
-
-
Method Details
-
getFilteredName
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
- Returns:
- String bundle name
-
getFormatString
- Returns:
- String bitstreamformat
-
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, boolean verbose) throws IOException, InterruptedException, org.im4java.core.IM4JavaException Return an image from a bitstream with specific processing options for PDFs. This is only used by ImageMagickPdfThumbnailFilter in order to generate an intermediate image file for use with getThumbnailFile.- 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
-