Compression not supported

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Pellegrino
Posts: 16
Joined: Wed Jun 17, 2009 5:00 pm

Compression not supported

Post by Pellegrino » Wed Jun 17, 2009 5:15 pm

Hello!

I've tried to save a Chart to file in JPEG-format using the ChartUtilities:

Code: Select all

ChartUtilities.saveChartAsJPEG(new File("chartline.jpg"), chart,  200,100);
but i've received the following error:

Code: Select all

java.lang.UnsupportedOperationException: compression not supported
   at javax.imageio.ImageWriteParam.checkSupportsCompression(libgcj.so.90)
   at javax.imageio.ImageWriteParam.setCompressionMode(libgcj.so.90)
   at org.jfree.chart.encoders.SunJPEGEncoderAdapter.encode(SunJPEGEncoderAdapter.java:167)
   at org.jfree.chart.encoders.EncoderUtil.writeBufferedImage(EncoderUtil.java:134)
   at org.jfree.chart.ChartUtilities.writeChartAsJPEG(ChartUtilities.java:428)
   at org.jfree.chart.ChartUtilities.saveChartAsJPEG(ChartUtilities.java:522)
   at org.jfree.chart.ChartUtilities.saveChartAsJPEG(ChartUtilities.java:474)
   at Charts.BuildJFreeChart.SaveBuildChart(BuildJFreeChart.java:134)
   at ReportTemplate.ReportTemplateImpl.ReportAllTrendImpl.addOverallChart(ReportAllTrendImpl.java:187)
   at GenerateSampleReport.createReport(GenerateSampleReport.java:145)
   at Main.main(Main.java:12)
Under the Windows it works, but under Ubuntu 9.0.4 it don't.

Any idea? Excuse me for my English...

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Compression not supported

Post by david.gilbert » Wed Jun 17, 2009 7:15 pm

You are using GCJ, which does not have complete support for all the Java APIs. I'd recommend that you use IcedTea or OpenJDK or Sun's JDK.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Pellegrino
Posts: 16
Joined: Wed Jun 17, 2009 5:00 pm

Re: Compression not supported

Post by Pellegrino » Thu Jun 18, 2009 9:23 am

Thanks, it works with OpenJDK.

Locked