Transparent Avatar Image

I was investigating why an avatar image that has a transparent background changes to a black background when you save your VCard.

Here is what I found.

The GraphicUtils class has a method called convert, this method converts the java.awt.Image to a java.awt.image.BufferedImage.

Existing Code:

BufferedImage bi = new BufferedImage(im.getWidth(null), im.getHeight(null), BufferedImage.TYPE_INT_RGB);

The BufferedImage.TYPE_INT_RGB does not support transparency, I changed it to BufferedImage.TYPE_INT_ARGB_PRE wich does support transparency and it works fine.

My question is, is there a reason that the BufferedImage’s imageType needs to be set to BufferedImage.TYPE_INT_RGB?

I cant answer your question, but i have filed this in JIRA. SPARK-1047

Any resolution on this (other than modifying the class myself)? I have notice the same issue with one of my users who is using an image with trancparency.

I applied patch for this issue

Thanks I did not realize that the crossed out link to SPARK-1047 was something I needed to follow. Now I just have to figure out how to apply the patch. I have no development tools - I am a system admin, not a developer.

Crossed out link means that this issue is marked as fixed in the bug tracker and patch code is applied to the source of Spark. You can compile latest SVN version of it, or wait till the release of test installer or beta or final release. Final release won’t be any soon.

Compiling from SVN http://community.igniterealtime.org/docs/DOC-1521

Latest versions (your patch is not yet in any installers available on that page) http://community.igniterealtime.org/docs/DOC-1822