8 Replies Latest reply on Apr 8, 2009 7:35 AM by njrfrens

    Image Type while using a4j:mediaOutput

    njrfrens

      I'm displaying a BufferedImage using a4j:mediaOutput, and the image is being displayed properly.

      In the browser(IE), when i right click on the image and select 'Save As', i'm having the option to save the image as bmp image only.

      When I do the same in firefox, i'm able to save the image as jpeg.

      Please help me in finding out the issue in my code ..?

      <a4j:mediaOutput element="img"
       cacheable="false" session="true"
       createContent="#{myBean.getChartImage}"
       mimeType="image/jpeg" />
      
      public class MyBean
      {
       public void getChartImage (OutputStream out, Object data) throws Exception {
       BufferedImage chartImage = getBufferedImage();
      
       if (pageImage != null) {
       ImageIO.write(chartImage, "jpeg", out);
       }
       }
      }