*/
public RenderedImage getPreviewImage( ImageInfo imageInfo, int maxWidth,
int maxHeight )
throws BadImageFileException, IOException, UnknownImageTypeException
{
final ImageMetadata metadata = imageInfo.getMetadata();
final ImageMetadataDirectory dir =
metadata.getDirectoryFor( CIFFDirectory.class );
if ( dir != null ) {
final ImageMetaValue colorSpace = dir.getValue( CIFF_COLOR_SPACE );
ColorSpace cs = JAIContext.sRGBColorSpace;
if ( colorSpace != null )
switch ( colorSpace.getIntValue() ) {