I'm not sure ImageWorker is working with jpeg format.
I tried your ideas for rrd4j and met two problems:
iwp.setCompressionQuality(quality)
is no use if used without:
writer.write(null, new IIOImage(outputImage, null, null), iwp);
writer.setOutput(...) don't take an OutputStream but an ImageOutputStream, that is build with:
ImageOutputStream imageStream = ImageIO.createImageOutputStream(stream);
My version can be found at: https://code.google.com/p/rrd4j/source/browse/src/main/java/org/rrd4j/graph/ImageWorker.java#182
I wrote a simple test class that you should use, see https://code.google.com/p/rrd4j/source/browse/src/test/java/org/rrd4j/graph/ImageWriterTest.java
I'm not sure ImageWorker is working with jpeg format.
I tried your ideas for rrd4j and met two problems:
iwp.setCompressionQuality(quality)
is no use if used without:
writer.write(null, new IIOImage(outputImage, null, null), iwp);
writer.setOutput(...) don't take an OutputStream but an ImageOutputStream, that is build with:
ImageOutputStream imageStream = ImageIO.createImageOutputStream(stream);
My version can be found at: https://code.google.com/p/rrd4j/source/browse/src/main/java/org/rrd4j/graph/ImageWorker.java#182
I wrote a simple test class that you should use, see https://code.google.com/p/rrd4j/source/browse/src/test/java/org/rrd4j/graph/ImageWriterTest.java