ImageOrientation orientation = metadata.getOrientation();
if (orientation != null) {
transposeAngle = orientation.getCorrection();
if (transposeAngle != null) {
ParameterBlock pb = new ParameterBlock();
pb.addSource(sourceImage);
pb.add(transposeAngle);
RenderedOp transposed = JAI.create("Transpose", pb, null);
transposed.setProperty(JAIContext.PERSISTENT_CACHE_TAG, Boolean.TRUE);
// sourceImage = transposed;