Here is a collection of frequently asked questions about Matte:
Currently there is a fairly crude AppleScript that comes in the scripts directory of the Matte binary distribution which will export the currently-selected album in iPhoto into a directory and generate an import XML document that preserves the album name, and for each item in the album its name, keywords, and comments. You then need only zip up the exported items with the import XML file, and then import that zip archive into Matte.
See the iPhoto AppleScript Export page for more info.
I do have plans to work on a real iPhoto export plugin someday, or if anyone with OS X programming skills wanted to contribute, this would be a welcome addition to Matte (email msqr@users.sourceforge.net if you're interested).
The default handler for images uses built-in Java classes to transform the images into other sizes. This approach can be very slow. A much faster approach is to use ImageMagick to transform images. Matte can be configured to use ImageMagick by way of JMagick, a Java-wrapper around the ImageMagick library. You'll need to have both installed in order to use this approach.
Once you have ImageMagick and JMagick installed you'll need to configure
your application server to support them. For Tomcat, an easy approach is to
copy the jmagick.jar
from JMagick into TOMCAT_HOME/common/lib
and then add -Djmagick.systemclassloader=no
to the CATALINA_OPTS
environment variable when starting Tomcat. For example, here is a sample shell
script to setup the required environment and then start Tomcat:
If you have JMagick and/or ImageMagick installed in a non-standard location,
you may need to tell Java where to find them by adding a -Djava.library.path
parameter to your CATALINA_OPTS
enviornment variable:
Finally, you have to configure Matte to use JMagick versions of the image
media handlers it uses. This is configured in the
WEB-INF/classes/environmentContext.xml
file located in the
Matte WAR file. An example of using JMagick is included in the binary distribution
of Matte, as setup/environmentContext-jmagick.xml
. Use this as a guide
to update your WEB-INF/classes/environmentContext.xml
copy.
JPEG-2000 support requires you to be using ImageMagick/JMagick, as described above. ImageMagick also needs to have been compiled with JPEG-2000 support. The open-source Jasper library provides an implementation that ImageMagick can use.
Once you have ImageMagick configured with JPEG-2000 support, then you just need
to configure Matte to use JMagick, as described above. Then make sure the
jpegMediaHandler
is configured to return JPEG-2000, like this:
<bean id="jpegMediaHandler" class="magoffin.matt.ma2.image.jmagick.JpegMediaHandler">
<property name="domainObjectFactory" ref="domainObjectFactory"/>
<property name="mediaBiz" ref="mediaBizTarget"/>
<property name="jmagickMediaEffectMap" ref="jmagickEffectMap"/>
<property name="useJpeg2000" value="true"/>
<property name="jpeg2000UserAgentRegExp">
<list>
<value>WebKit</value>
</list>
</property>
</bean>
The useJpeg2000 property should be set to true
. Also the
jpeg2000UserAgentRegExp list should be configured to match the browser
User-Agent
HTTP header values you want to serve JPEG-2000 images
to (since not all browsers support JPEG-2000 images natively). This list is
composed of Java regular expressions, and if any of them match JPEG-2000 will be
returned, otherwise normal JPEG images will be returned. In the example above,
the text WebKit
will match Apple's Safari browser, which supports
JPEG-2000 images.
Matte can use either of two libraries to support video files: Java Media Framework (JMF) or QuickTime for Java (QTJ). Similarly to how JMagick is configured (see above), once either (or both) of these are installed on your server then you need to configure your application server to support them, and then configure Matte to use them for video files.
For example in Tomcat to support JMF, copy the jmf.jar
into
TOMCAT_HOME/common/lib
. If JMF is installed in a non-standard location, you
may need to add the location to Java's library path. For example, here is a shell
script that configures the environment for Tomcat to start:
Similarly for QuickTime, copy the QTJava.zip
and QTJSupport.jar
files into TOMCAT_HOME/common/lib
.
Finally, Matte must be configured to handle the video media types. This is configured in the
WEB-INF/classes/environmentContext.xml
file located in the
Matte WAR file. An example of using JMF and QuickTime is included in the binary distribution
of Matte, as setup/environmentContext-video.xml
. Use this as a guide
to update your WEB-INF/classes/environmentContext.xml
copy.
Most likely this occurs on a Unix-like server where the user the application server
is running as does not have access to X Windows (perhaps the server is started up without
X Windows). One solution is to pass -Djava.awt.headless=true
to Java when
you start your application server. For example a shell script to start Tomcat might
look like this:
Another solution is to make sure the user the application server runs as has access to an X Windows server. If you do have an X Server running, but Java still complains that it cannot connect to it, you might need to grant access to it for the user the application server runs as, for example
Another solution would be to run a virtual X Server, such as
Xvfb. With
this approach you probably need to specify the DISPLAY
environment
variable when starting your application server if it is not already set. For example
a shell script to start Tomcat might look like: