Hi Scott,

I was able to get TIFFs filtered using JAI in DSpace 1.4.2; we didn't get JAI 
installed when we upgraded to DSpace 1.6 (new server), so I can't say for 
certain if it still works, but I'd imagine it does.  The instructions are 
detailed below.  I think that some of the code changes are unnecessary now, as 
the DSpace source has also been updated in the same way this "patch" required.

If you find this still works, I'd be happy to know.  We're considering whether 
to try to implement it again when we upgrade to 1.8.

B--

_________________________________________________________________________________________________________

Two settings in /config/dspace.cfg need to be updated to include the TIFF 
format in the list of file formats that the filters will extract:

    filter.org.dspace.app.mediafilter.JPEGFilter.inputFormats = GIF, JPEG, 
TIFF, image/png
    filter.org.dspace.app.mediafilter.BrandedPreviewJPEGFilter.inputFormats = 
GIF, JPEG, TIFF, image/png

TIFF Extractor Add-On

filter-media, ugly JPEGS, TIFFs, and Java Advanced Imaging
Creator: Wesley Alan Wright <wesley.wright@uv...> - 2005-01-27 13:02 

File:  src/org/dspace/app/JPEGFilter.java

Make sure "Java Advanced Imaging" is installed:  
http://java.sun.com/products/java-media/jai/index.jsp 

Install the jars and .so files in dspace-1.2.1beta4-source/lib

diffs:
------------ %< cut here >%--------

46c46
< import javax.imageio.ImageIO;
---
> import javax.imageio.*;
48a49,50
> import javax.media.jai.*;
> import com.sun.media.jai.codec.*;
104,105c106,116
< BufferedImage buf = ImageIO.read(source);
<
---
> /* BufferedImage buf = ImageIO.read(source);
> */
> SeekableStream s = SeekableStream.wrapInputStream(source, true);
> PlanarImage image = JAI.create("stream", s);
> BufferedImage buf =image.getAsBufferedImage();
> if (MediaFilterManager.isVerbose) {
> String[] formatNames=ImageIO.getReaderFormatNames();
> for (int i=0; i<formatNames.length; i++) {
> System.out.println("formats "+formatNames[i]); 
> }
> }
173c184
< .getHeight(null), BufferedImage.TYPE_3BYTE_BGR);
---
> .getHeight(null), BufferedImage.TYPE_INT_RGB);
191c202
< }
\ No newline at end of file
---
> }

_______________________________________________________________________________________________________________________________________________




>>> On 3/21/2012 at 1:32 PM, in message
<caps1sdn0xv6diqepuoz3zcl-fpngrnv_6501g98fot6ap-z...@mail.gmail.com>, Scott
Phillips <[email protected]> wrote:
> DSpacers,
> 
> Has anyone been able to make the media-filter process JPEG 2000 image
> files? The current media-filter used by DSpace makes use of these libraries
> as part of the Java Standard Edition. By default Java SE comes with support
> for the basic image types: jpeg, gif, png, bit map, etc... However if you
> install the Java Advanced Imaging Library (JAI) locally then the
> appropriate plugins will be installed to support JPEG 2000 and TIFF. This
> shouldn't require any code changes on the part of DSPace, but would require
> a system administrator to locally install JAI.
> 
> http://download.java.net/media/jai/builds/release/1_1_3/INSTALL.html 
> 
> However, I've been banging my head on this problem for a few days now and
> I've never been able to get JAI to work. I've also not been able to find
> any open source projects that process JPEG 2000 images using JAI. So, has
> anyone been able to get this to work?
> 
> 
> 
> As a follow up to that question, I've been looking at the open source
> projects which do process JPEG 2000 images. The big one that I've found is
> Djatoka, we're running it locally and it's a tomcat java web app that can
> process the JPEG images. They are not using JAI but instead using Kakadu,
> which is a commercial library written in C. They have embedded the binaries
> for all the major OS Platforms within the webapp and then load the
> appropriate libraries for the particular platform. Then with a java wrapper
> they are able to make calls out to the pre-build binaries. Kakadu is
> normally a commercial product, however they do offer "Non Commercial" and
> "Public Service" licenses which might work for DSpace.
> 
> Assuming that the JAI library does not actually work, If A&M we're to
> develop a JPEG 2000 media filter that used the Kakadu would
> DSpace/Duraspace be open to managing the public service or non commercial
> license? I am assuming this would have to be a separate module that one
> could optionally include as a maven dependency which would provide this
> media-filter because the Kakadu license does restrict to "non commercial
> uses" and some people use DSpace for commercially.
> 
> Scott--

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to