Improve support of transparent avatars

Description

from forum post: http://www.igniterealtime.org/community/message/188635#188635

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?

Environment

None

Activity

Show:
Walter Ebeling
February 24, 2013, 9:29 AM

Mass closing of resolved issues

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Priority

Minor

Assignee

Konstantin Zolotarev

Reporter

wroot