String fname = imageFile.getName();
int lastDotPos = fname.lastIndexOf( "." );
if ( lastDotPos <= 0 || lastDotPos >= fname.length()-1 ) {
throw new IOException( "Cannot determine file type extension of " + imageFile.getAbsolutePath() );
}
PhotovaultImageFactory imageFactory = new PhotovaultImageFactory();
PhotovaultImage img = null;
try {
/*
Do not read the image yet since setting raw conversion
parameters later may force a re-read.
*/
img = imageFactory.create(imageFile, false, false);
} catch (PhotovaultException ex) {
log.error( ex.getMessage() );
}
img.setCropBounds( this.getCropBounds() );
img.setRotation( prefRotation - original.getRotated() );