Board index » off-topic » Re: TBitmap bug

Re: TBitmap bug


2004-12-04 04:02:26 AM
off-topic8
Luis Dib wrote:
Quote
This message relates to the message with same name posted in
b.p.d.vcl.components.using-general.

The attached bitmap fails to load in a Delphi's TBitmap, however it
works with Windows Explorer and Paint. It was generated with
Photoshop.

-Luis
It seems XanaNews (written in Delphi, using Indy), can't even save it.
I had to use WinZip to extract it from the message. Just to be sure, I
posted it with XanaNews, and the same happened.
--
Rudy Velthuis [TeamB]
"Some cause happiness wherever they go; others, whenever they go."
- Oscar Wilde (1854-1900)
 
 

Re:Re: TBitmap bug

"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
Luis Dib wrote:

>This message relates to the message with same name posted in
>b.p.d.vcl.components.using-general.
>
>The attached bitmap fails to load in a Delphi's TBitmap, however it
>works with Windows Explorer and Paint. It was generated with
>Photoshop.
>
>-Luis

It seems XanaNews (written in Delphi, using Indy), can't even save it.
I had to use WinZip to extract it from the message. Just to be sure, I
posted it with XanaNews, and the same happened.
--
Rudy Velthuis [TeamB]

"Some cause happiness wherever they go; others, whenever they go."
- Oscar Wilde (1854-1900)
I posted patch directions to fix that in the vcl group. Seems to do the
trick.
-Luis
 

Re:Re: TBitmap bug

Luis Dib wrote:
Quote
"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote in message
news:xn0dql2y2kxodm002rudys-toshiba@www.teamb.com...
>Luis Dib wrote:
>
>>This message relates to the message with same name posted in
>>b.p.d.vcl.components.using-general.
>>
>>The attached bitmap fails to load in a Delphi's TBitmap, however it
>>works with Windows Explorer and Paint. It was generated with
>>Photoshop.
>>
>>-Luis
>
>It seems XanaNews (written in Delphi, using Indy), can't even save
>it. I had to use WinZip to extract it from the message. Just to be
>sure, I posted it with XanaNews, and the same happened.
>--
>Rudy Velthuis [TeamB]
>
>"Some cause happiness wherever they go; others, whenever they go."
>- Oscar Wilde (1854-1900)

I posted patch directions to fix that in the vcl group. Seems to do
the trick.

-Luis
Fixes the TBitmap problem, but not the other one with XanaNews. <g>
--
Rudy Velthuis [TeamB]
"There is a charm about the forbidden that makes it unspeakably
diserable." -- Mark Twain.
 

{smallsort}

Re:Re: TBitmap bug

Access violation in module
<news:xn0dqm6291kyan100wrudys-toshiba@www.teamb.com>at address Rudy Velthuis
[TeamB]. See explanation below:
Quote
Fixes the TBitmap problem, but not the other one with XanaNews. <g>
I'm using XanaNews too, and have no problem with saving attached bmp file.
--
_______
| ___|.-----.-----.-----.
| ___|| _ | _ | |
|_______||___ |_____|__|__|
|_____|
 

Re:Re: TBitmap bug

Luis Dib wrote:
Quote
This message relates to the message with same name posted in
b.p.d.vcl.components.using-general.

The attached bitmap fails to load in a Delphi's TBitmap, however it
works with Windows Explorer and Paint. It was generated with
Photoshop.

-Luis
Technically it's an invalid bitmap. The biSizeImage field in the
header is too big. (It's 49154. For an uncompessed RGB bitmap it
should actually be width*height*bytes-per-pixel == 128*128*3 == 49152).
But it would be nice if TBitmap checked that this field has the correct
value, rather than throwing an AV!
--
Colin - Author of XanaNews 1.17.0.0
web: www.wilsonc.demon.co.uk/delphi.htm
 

Re:Re: TBitmap bug

Hi,
Note. the biSizeImage "Byte Per Line" must be 4BYTE or DWORD alignment.
Regards
KL Chin
"Colin Wilson" < XXXX@XXXXX.COM >wrote in message
Quote
Luis Dib wrote:

>This message relates to the message with same name posted in
>b.p.d.vcl.components.using-general.
>
>The attached bitmap fails to load in a Delphi's TBitmap, however it
>works with Windows Explorer and Paint. It was generated with
>Photoshop.
>
>-Luis

Technically it's an invalid bitmap. The biSizeImage field in the
header is too big. (It's 49154. For an uncompessed RGB bitmap it
should actually be width*height*bytes-per-pixel == 128*128*3 == 49152).

But it would be nice if TBitmap checked that this field has the correct
value, rather than throwing an AV!


--
Colin - Author of XanaNews 1.17.0.0

web: www.wilsonc.demon.co.uk/delphi.htm
 

Re:Re: TBitmap bug

KL Chin wrote:
Quote
Note. the biSizeImage "Byte Per Line" must be 4BYTE or DWORD
alignment.
Possibly! That's why it's best to leave biSizeImage as zero for BI_RGB
bitmaps.
But it doesn't make any difference with this particular bitmap.
Everything is DWORD aligned with it (apart from the incorrect 49154
value!)
--
Colin - Author of XanaNews