output = new ByteArrayOutputStream();
ImageFormat outputFormat = ImageUtils.isGIF(inputStream) ? ImageFormat.GIF : ImageFormat.JPEG;
ScaleParameter scaleParam = new ScaleParameter(maxWidth, maxHeight, Algorithm.AUTO);
ImageRender rr = new ReadRender(inputStream, true);
ImageRender dtr = new DrawTextRender(rr, drawParam);
ImageRender sr = new ScaleRender(dtr, scaleParam);
wr = new WriteRender(sr, output, outputFormat);
wr.render();
} catch (Exception e) {