Jp2 batch converter

Description
The jp2 files used by the Secondlife client, are actually j2k files. These can be encoded by image_to_j2k from openjpeg. The script identifies the image-resolution, and converts the image to a valid SL-resolution/aspect ratio. Subsequently it checks for jpg-files, and converts them to valid openjpeg input files if necessary. Valid openjpeg files are then converted to j2k fileformat, by image_to_j2k. At last the j2k file is renamed to jp2, and can be used as an secondlife texture. Use genassets.pl to generate an asset-set out of these files.

Usage
svn co http://www.openjpeg.org/svn/trunk cd trunk mkdir bin cd bin cmake .. -DBUILD_EXAMPLES:BOOL=ON make make install PATH=/usr/local/bin:$PATH Add /usr/local/bin to /etc/profile for a permanent path.
 * Install OpenJPEG svn (if you have trouble compiling, you could try the binaries on their site)
 * Make sure that the binaries image_to_j2k and j2k_to_image can be executed from anywhere

perl jp2batch.pl "/some directory/with/images"
 * Put the code in a file named jp2batch.pl, and copy it to the /opt/opensim/scripts directory. The script uses a directory as parameter: