Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-02

TBitmap unable to Load certain BMP files..

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dominique Louis

Hi all
I have the situation where a Delphi TBitmap class is able to load a particular .bmp image while the LCL version of TBitmap throws an exception. I tried loading the image both via a stream and also saving it, then doing a LoadFromFile and in both cases it AVs.

Firstly is there a known issue with any particular types of Bitmap images?

Secondly, is anyone already looking at improving Lazarus's TBitmap compatibilities and if I were to send them the offending bitmap, would that help in any way?

Thanks.

Dominique.

Reply by email

Sebastian Günther
to Dominique Louis
Hi all I have the situation where a Delphi TBitmap class is able to load a particular .bmp image while the LCL version of TBitmap throws an exception.

What exception is it exactly? Can you tell the value of Exception.Message?

Firstly is there a known issue with any particular types of Bitmap images?

I personally encountered problems when dealing with RLE compressed bitmaps, which are quite common. For example, the icon sets from GlyFX use RLE encoding, which Lazarus/LCL can not handle. I recently provided a patch, but the discussion about accepting this patch or not unfortunately has died.

Secondly, is anyone already looking at improving Lazarus's TBitmap compatibilities and if I were to send them the offending bitmap, would that help in any way?

This would help very much; I think you can simply post your file to this mailing list, if it's not too huge.

Regards,

Sebastian

Reply by email

Marco van de Voort
to Dominique Louis: Hi all I have the situation where a Delphi TBitmap class is able to load a particular…
Dominique Louis wrote 6 lines
I have the situation where a Delphi TBitmap class is able to load a particular .bmp image while the LCL version of TBitmap throws an exception. I tried loading the image both via a stream and also saving it, then doing a LoadFromFile and in both cases it AVs. Firstly is there a known issue with any particular types of Bitmap images?

I just happen to look into fpimage (fcl-image) today to see if I can add scanline support and generally speed it up a bit. Lazarus image support seems partially fpimage based, partially not.

Secondly, is anyone already looking at improving Lazarus's TBitmap compatibilities and if I were to send them the offending bitmap, would that help in any way?

I'm interested anyway. Best is maybe to add the offending file and a short example on mantis. Reply the bugnumber to this post.

See also next msg.

Reply by email

Marco van de Voort
to Sebastian Günther: What exception is it exactly? Can you tell the value of Exception.Message? I personally…
Sebastian G?nther wrote 12 lines
Dominique Louis schrieb: > Hi all > I have the situation where a Delphi TBitmap class is able to load a > particular .bmp image while the LCL version of TBitmap throws an > exception. What exception is it exactly? Can you tell the value of Exception.Message? > Firstly is there a known issue with any particular types of Bitmap images? I personally encountered problems when dealing with RLE compressed bitmaps, which are quite common.

Afaik the fpimage readers that lazarus uses support bi_RLE4 and bi_RLE8. So it should be automagically decompressed?

Reply by email

Sebastian Günther
to Marco van de Voort
Show quoted text 14 lines
On Sat, Feb 16, 2008 at 12:46:53AM +0100, Sebastian G?nther wrote: > Dominique Louis schrieb: >> Hi all >> I have the situation where a Delphi TBitmap class is able to load a >> particular .bmp image while the LCL version of TBitmap throws an >> exception. > What exception is it exactly? Can you tell the value of Exception.Message? > >> Firstly is there a known issue with any particular types of Bitmap images? > I personally encountered problems when dealing with RLE compressed > bitmaps, which are quite common. Afaik the fpimage readers that lazarus uses support bi_RLE4 and bi_RLE8. So it should be automagically decompressed?

Hi Marco,

I don't know the internals about how the LCL does handle the image loading. It seems that the LCL has its own mechanism for loading BMP files. Some weeks ago, before I posted the patch for dealing with RLE compressed files within Lazarus, I noticed that the LCL image loader cannot deal with such files. Apparently the LCL implementation tries to be more performant as the fpImage version, but cannot handle compressed BMPs.
I'm sorry about this, but actually I don't have the time to look further at this topic. So someone like Mattias should either take my patch, or modify LCL to use the fpImage implementation.

Greetings,
Sebastian

Reply by email

Dominique Louis
to Sebastian Günther

Hi Sebastian,
I'll try out your patch first as it's taken me a while to track down this issue, so I'll see if that works first. If it does not work, I'll the offending image to this thread.

Thanks,

Dominique.

Sebastian G?nther wrote 31 lines
Marco van de Voort schrieb: > On Sat, Feb 16, 2008 at 12:46:53AM +0100, Sebastian G?nther wrote: >> Dominique Louis schrieb: >>> Hi all >>> I have the situation where a Delphi TBitmap class is able to load a >>> particular .bmp image while the LCL version of TBitmap throws an >>> exception. >> What exception is it exactly? Can you tell the value of Exception.Message? >> >>> Firstly is there a known issue with any particular types of Bitmap images? >> I personally encountered problems when dealing with RLE compressed >> bitmaps, which are quite common. > Afaik the fpimage readers that lazarus uses support bi_RLE4 and bi_RLE8. So > it should be automagically decompressed? Hi Marco, I don't know the internals about how the LCL does handle the image loading. It seems that the LCL has its own mechanism for loading BMP files. Some weeks ago, before I posted the patch for dealing with RLE compressed files within Lazarus, I noticed that the LCL image loader cannot deal with such files. Apparently the LCL implementation tries to be more performant as the fpImage version, but cannot handle compressed BMPs. I'm sorry about this, but actually I don't have the time to look further at this topic. So someone like Mattias should either take my patch, or modify LCL to use the fpImage implementation. Greetings, Sebastian

Reply by email