ImageInfo imageInfo = imp.getImageInfo(outputFile);
if( imageInfo.orientation == ImageInfo.Orientation.REQUIRES_CONVERSION ){
File convertedFile = File.createTempFile("oriented_", attDescription.getMediaFileName());
imp.reorientImage(outputFile, convertedFile);
attDescription.uploadFile(convertedFile, mimeType);
}
ServerWorkDescriptor serverWork = attDescription.getServerWorkDescription();
serverWork.setOrientationLevel(UploadConstants.SERVER_ORIENTATION_VALUE);
}