SUNScholar/Media Filters/3.X

From Libopedia
Jump to navigation Jump to search
Back to Thumbnails


After a while we noticed our server load increasing radically when doing the nightly media-filter jobs. We isolated the problem to the "Branded Preview JPEG" filter. This filter has been disabled as these branded previews are not important to us.


Check the following and then return.

Step 1 - Login to the server

Complete ALL of the following as the "dspace" user!

Step 2 - Install the Ubuntu software packages

Type the following:

sudo apt-get install xpdf poppler-utils curl

Step 3 - Install the java packages

Step 3A - Install "jai_imageio.jar"

mkdir $HOME/temp 
cd $HOME/temp
curl -O
tar -xzvf jai_imageio-1_1-lib-linux-i586.tar.gz
 mvn install:install-file \
                    -Dfile=jai_imageio-1_1/lib/jai_imageio.jar  \
                    -DartifactId=jai_imageio                    \
                    -Dversion=1.0_01                            \
                    -Dpackaging=jar                             \

Step 3B - Install "jai_core.jar"

mkdir $HOME/temp 
cd $HOME/temp 
wget --no-check-certificate
mvn install:install-file \
                    -Dfile=jai_core-1.1.2_01.jar  \
                    -DartifactId=jai_core                      \
                    -Dversion=1.1.2_01                         \
                    -Dpackaging=jar                            \

Step 4 - Configuration

Step 4A

Edit the "dspace.cfg" file.

nano $HOME/source/dspace/config/dspace.cfg

First enable thumbnails, search for following and change to true: = true = true
webui.preview.enabled = true

Then, search for the following and change as needed:

webui.preview.brand = My Institution Name
webui.preview.brand.abbrev = MyOrg

Lastly, be sure there is a value for thumbnail.maxwidth and that it corresponds to the size you want for preview images for the UI.

Search for the following and modify.

# maximum width and height of generated thumbnails
thumbnail.maxwidth  = 160
thumbnail.maxheight = 160

Step 4B

Search for "filter.plugins" and replace with the following.

filter.plugins = \
        PDF Text Extractor, \
        PDF Thumbnail, \
        HTML Text Extractor, \
        Word Text Extractor, \
        PowerPoint Text Extractor, \
        JPEG Thumbnail, \
        Branded Preview JPEG

Step 4C

Change the MediaFilter plugin configuration to remove the old "" and add the new filters " = PDF Text Extractor" and " = PDF Thumbnail". Replace with the following. = \ = PDF Text Extractor, \ = HTML Text Extractor, \ = Word Text Extractor, \ = PowerPoint Text Extractor, \ = PDF Thumbnail, \ = JPEG Thumbnail, \ = Branded Preview JPEG

Step 4D

Then replace " = Adobe PDF" with the following: = Adobe PDF = Adobe PDF

Step 4E

Above the comment, "#Custom settings for PDFFilter", add the following:

#The paths to the XPDF utilities
xpdf.path.pdftotext = /usr/bin/pdftotext
xpdf.path.pdftoppm  = /usr/bin/pdftoppm
xpdf.path.pdfinfo   = /usr/bin/pdfinfo

Step 5 - Build and Install

To build, type the following:

cd $HOME/source
mvn -U clean package -Pxpdf-mediafilter-support

To install, type the following: (Replace XXX with your DSpace version number)

cd $HOME/source/dspace/target/dspace-XXX-build
ant update
ant clean_backups

Step 6 - Update dspace rebuild script

If the test build works then add the switch"-Pxpdf-mediafilter-support" to the dspace rebuild script, so that:

mvn -U clean package


mvn -U clean package -Pxpdf-mediafilter-support


Step 7 - Test the media filers

Restart DSpace and then type the following to test. Select an item that has pdf files attached and use it as replacement for "123456789/29097".

$HOME/bin/dspace filter-media -n -v -i 123456789/29097

Step 8 - Create new thumbnails

The scripts are configured to do 1000 items at a time only. This saves on memory and CPU time. Therefore on a large system you may need to run the script several times. Also make sure that the dspace user has full read/write access to all items in the assetstore folders (sudo chmod 0777 -R $HOME/assetstore/).

$HOME/bin/dspace filter-media -n -v -m 1000 -p "PDF Thumbnail"
$HOME/bin/dspace filter-media -n -v -m 1000 -p "JPEG Thumbnail"
$HOME/bin/dspace filter-media -n -v -m 1000 -p "Branded Preview JPEG"

Step 9 - Add a daily admin task

See: Check the "filter-media" options!

Step 10 - Item list preview settings

Edit the "dspace.cfg" file and search for xmlui.theme.mirage.item-list.emphasis. There are two options available namely "metadata" or "file", select "file" and save the "dspace.cfg" file, then rebuild DSpace.