Difference between revisions of "SUNScholar/Media Filters/5.X"
m |
|||
| Line 17: | Line 17: | ||
Edit the ''"dspace.cfg"'' file. | Edit the ''"dspace.cfg"'' file. | ||
| − | nano $HOME/ | + | nano $HOME/{{Source}}/config/dspace.cfg |
Search for the following and modify. | Search for the following and modify. | ||
<pre> | <pre> | ||
Revision as of 13:58, 3 June 2015
Back to Thumbnails
Contents
PLEASE NOTE:
The media filters have changed by incorporating the use of ImageMagick and Ghostscript. See the link below for details about enabling media filters.
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.
Step 1 - Install the Ubuntu software packages
Type the following:
sudo apt-get install imagemagick ghostscript
Step 2 - Configuration
Check the value for thumbnail.maxwidth and that it corresponds to the size you want for preview images for the UI.
Edit the "dspace.cfg" file.
nano $HOME/source/config/dspace.cfg
Search for the following and modify.
# maximum width and height of generated thumbnails thumbnail.maxwidth = 160 thumbnail.maxheight = 160
Filters
Enable filters as follows:
#Names of the enabled MediaFilter or FormatFilter plugins
filter.plugins = PDF Text Extractor, HTML Text Extractor, Word Text Extractor, \
PowerPoint Text Extractor, \
Branded Preview JPEG, \
ImageMagick Image Thumbnail, ImageMagick PDF Thumbnail
Names
Assign names for filters as follows:
#Assign 'human-understandable' names to each filter plugin.named.org.dspace.app.mediafilter.FormatFilter = \ org.dspace.app.mediafilter.PDFFilter = PDF Text Extractor, \ org.dspace.app.mediafilter.HTMLFilter = HTML Text Extractor, \ org.dspace.app.mediafilter.WordFilter = Word Text Extractor, \ org.dspace.app.mediafilter.PowerPointFilter = PowerPoint Text Extractor, \ org.dspace.app.mediafilter.BrandedPreviewJPEGFilter = Branded Preview JPEG, \ org.dspace.app.mediafilter.ImageMagickImageThumbnailFilter = ImageMagick Image Thumbnail, \ org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter = ImageMagick PDF Thumbnail
Input Formats
Assign MIME file types to media filters as follows:
#Configure each filter's input format(s) filter.org.dspace.app.mediafilter.PDFFilter.inputFormats = Adobe PDF filter.org.dspace.app.mediafilter.HTMLFilter.inputFormats = HTML, Text filter.org.dspace.app.mediafilter.WordFilter.inputFormats = Microsoft Word filter.org.dspace.app.mediafilter.PowerPointFilter.inputFormats = Microsoft Powerpoint, Microsoft Powerpoint XML filter.org.dspace.app.mediafilter.BrandedPreviewJPEGFilter.inputFormats = BMP, GIF, JPEG, image/png filter.org.dspace.app.mediafilter.ImageMagickImageThumbnailFilter.inputFormats = BMP, GIF, image/png, JPG, TIFF, JPEG, JPEG 2000 filter.org.dspace.app.mediafilter.ImageMagickPdfThumbnailFilter.inputFormats = Adobe PDF
Permissions
Configure media filter permissions. Search for "filter.org.dspace.app.mediafilter.publicPermission" and modify as follows:
#Publicly accessible thumbnails of restricted content. #List the MediaFilter name's that would get publicly accessible permissions #Any media filters not listed will instead inherit the permissions of the parent bitstream filter.org.dspace.app.mediafilter.publicPermission = BrandedPreviewJPEGFilter, ImageMagickImageThumbnailFilter, ImageMagickPdfThumbnailFilter
Step 3 - Rebuild DSpace
Step 4 - Test the media filers
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 5 - Create new thumbnails
The script is 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 asset store folders.
$HOME/bin/dspace filter-media -n -v -f -m 1000 -p "ImageMagick PDF Thumbnail"
$HOME/bin/dspace filter-media -n -v -f -m 1000 -p "ImageMagick Image Thumbnail"
Step 6 - Add a daily admin task
See: http://wiki.lib.sun.ac.za/index.php/SUNScholar/Daily_Admin. Check the "filter-media" options!
Step 7 - 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. See example below.
### Settings for Item lists in Mirage theme ### # What should the emphasis be in the display of item lists? # Possible values : 'file', 'metadata'. If your repository is # used mainly for scientific papers 'metadata' is probably the # best way. If you have a lot of images and other files 'file' # will be the best starting point # (metdata is the default value if this option is not specified) xmlui.theme.mirage.item-list.emphasis = file