//
BufferedImage img = ImageIO.read(in);
log.debug("Read image " + uri + " (" + img.getWidth() + "," + img.getHeight() + ")");
AffineTransform tx = AffineTransform.getScaleInstance(-1, 1);
tx.translate(-img.getWidth(null), 0);
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
img = op.filter(img, null);
log.debug("Mirrored image " + uri + " (" + img.getWidth() + "," + img.getHeight() + ")");
ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
ImageIO.write(img, imageType.getFormat(), baos);
baos.close();
return new Image(imageType, baos.toByteArray());