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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to