How to replace com.sun.image.codec.jpeg.JPEGImageEncoder in this code?

Use ImageIO, it can read/write JPEG, PNG, GIF, and BMP out of the box.

ImageIO.write(ChartImage, "jpeg", out);

Usually the static write(...) and read(...) methods are enough, if you need to control compression or handle image meta data, check out the Java Image I/O API Guide.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)