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

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 Details

  • Constructor Details

    • ImageMagickThumbnailFilter

      public ImageMagickThumbnailFilter()
  • Method Details

    • getFilteredName

      public String getFilteredName(String oldFilename)
      Description copied from interface: FormatFilter
      Get 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:
      IOException
      InterruptedException
      org.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:
      IOException
      InterruptedException
      org.im4java.core.IM4JavaException
    • preProcessBitstream

      public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) throws Exception
      Description copied from class: MediaFilter
      Perform 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:
      preProcessBitstream in interface FormatFilter
      Overrides:
      preProcessBitstream in class MediaFilter
      Parameters:
      c - context
      item - item containing bitstream to process
      source - source bitstream to be processed
      verbose - verbose mode
      Returns:
      true if bitstream processing should continue, false if this bitstream should be skipped
      Throws:
      Exception - if error