xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harshini Madurapperuma <harshini.madurapper...@ifs.lk>
Subject RE: Bitmap support in BmpImage.java class ?
Date Thu, 03 Apr 2008 05:56:23 GMT
Hi Jeremias,

I was working with Bitmap processing and the FOP version 0.94 doesn't support 16 bit bitmaps.
Then You said the newer version FOP Trunk ( 0.95) will definetly work for 16 bits and it'll
be available by the end of February/March this year.

Is it available now? If so can I get code for 16 bit support?

Thanx in advance
Regard
Harshini



-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
Sent: Wednesday, February 13, 2008 3:08 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Bitmap support in BmpImage.java class ?

I know 16 bit works with FOP Trunk (and 0.95 when it is available). I don't know about 32
bit because I don't have a bitmap editor that can save 32-bit BMP images. If you can send
me such a 32bit BMP I'll gladly test it with FOP Trunk.

0.94 still has the old image loading package. However, it could be that it supports 16 bit
images. I haven't checked but if it does you may be able to get an idea how to decode 16bit
images directly. FOP Trunk contains a completely new image loading framework which mostly
uses ImageIO to load images so I don't really care about the individual formats anymore but
delegate that to the codecs. This is similar to using JAI. But trust me, you don't want to
backport the new image loading framework back into 0.20.5. That's far more work than hacking
JAI into 0.20.5 to load all sorts of BMP images.

So why don't you go with the JAI suggestion? I have no easier solution for you.

On 13.02.2008 10:04:57 Harshini Madurapperuma wrote:
> Hi Jeremias,
>
> Thanks for your valid suggestions. Does 0.95 supports for 16 and 32
> bit images? What about the previous versions before 0.95? If you have
> a higher version can I get the algorithm or the code?
>
> Thanks
> Harshini.
>
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Wednesday, February 13, 2008 12:36 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Bitmap support in BmpImage.java class ?
>
> Sure, you can. Either you replace BmpImage with the JAI implementation as discussed earlier
or you change BmpImage. In the latter case, you have to convert the 16 and 32 bit image data
to 24 bit RGB. Otherwise, the renderers will not process the image data correctly (FOP Trunk
is much more flexible here). For this you need to know a few things about the BMP format.
Start here to get more information:
> http://en.wikipedia.org/wiki/BMP_file_format
>
> I think it's probably easiest if you use ImageIO or JAI to load BMP
> images and convert them to the required 24bit pixel stream using the
> BufferedImage.getRGB() method as done in JAIImage. But if I were you I'd try to upgrade
FOP at least as soon as 0.95 is available next month.
>
> On 13.02.2008 05:11:01 Harshini Madurapperuma wrote:
> >  Hi all;
> >
> > I have the fop version 0.20.5, and I have to work with bitmap images.
> > In BmpImage.java class the code supports only for 1,4,8 and 24 bit
> > sizes, otherwise it throws an exception. Can't I modify this to
> > support for 16 and 32 bits also with out changing the fop version.
> > Your suggestions would be greatly appreciated.
> >
> > if (this.m_bitsPerPixel == 1)
> >             bytes = (this.m_width + 7) / 8;
> >         else if (this.m_bitsPerPixel == 24)
> >             bytes = this.m_width * 3;
> >         else if (this.m_bitsPerPixel == 4 || this.m_bitsPerPixel == 8)
> >             bytes = this.m_width / (8 / this.m_bitsPerPixel);
> >         else
> >             throw new FopImageException("Image (" + this.m_href.toString()
> >                                         + ") has " + this.m_bitsPerPixel
> >                                         + " which is not a supported
> > BMP format...");
> >
> > Regards,
> > Harshini.
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
> ----------------------------------------------------------------------
> --------
>
> CONFIDENTIALITY AND DISCLAIMER NOTICE
>
> This e-mail, including any attachments, is confidential and intended
> only for the addressee. If you are not the intended recipient, please
> notify us immediately and delete this e-mail from your system. Any use
> or disclosure of the information contained herein is strictly prohibited.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

------------------------------------------------------------------------------

CONFIDENTIALITY AND DISCLAIMER NOTICE

This e-mail, including any attachments, is confidential and intended only for
the addressee. If you are not the intended recipient, please notify us
immediately and delete this e-mail from your system. Any use or disclosure of
the information contained herein is strictly prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message