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

Attachments

1

Activity

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

Mass closing of resolved issues

Fixed

Details

Priority

Assignee

Reporter

Affects versions

Components

Created March 5, 2009 at 10:45 AM
Updated February 24, 2013 at 9:29 AM
Resolved September 11, 2010 at 6:45 AM