View Issue Details

IDProjectCategoryView StatusLast Update
0008553LazarusLCLpublic2012-02-21 14:13
ReporterLuiz AmericoAssigned ToZeljan Rikalo 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.0.0Fixed in Version 
Summary0008553: A crash occurs when using a TBitmap with PixelFormat pf32bit under GTK
DescriptionTrying to BitBlt a TBitmap with pf32bit causes a fatal gdk error:

Gdk-ERROR **: BadMatch (invalid parameter attributes)
  serial 2057 error_code 8 request_code 62 minor_code 0

Using pfDevice works fine

See attached example
TagsNo tags attached.
Fixed in Revision35177
LazTarget1.0
WidgetsetGTK, GTK 2
Attached Files

Activities

2007-03-19 15:56

 

BitBltGTK.zip (2,987 bytes)

Vincent Snijders

2010-11-30 10:35

manager   ~0043776

Does this error occur with gtk2 too?

Anton Kavalenka

2010-11-30 10:50

reporter   ~0043779

Last edited: 2010-11-30 10:58

It simply does not work (no blue rectangle with pf32bit).
And broken is TBitmap.Canvas.FillRect() but not bitblt().

I added into form the TImage instance and a single line into click handler

Image1.Picture.Assign(ABitmap);

Zeljan Rikalo

2010-11-30 10:57

developer   ~0043782

Not error, but it doesn't paint under gtk2 (no blue bitmap). Under qt works fine (but I had to change example so it paints PaintBox1 in OnPaint event.

Zeljan Rikalo

2010-11-30 11:08

developer   ~0043784

ok, I've found where's problem (gtk2)

Zeljan Rikalo

2010-11-30 11:23

developer   ~0043787

Last edited: 2010-11-30 11:27

Same problem is under gtk.
TGtk2WidgetSet.RawImage_CreateBitmaps()
if (ImgData <> nil) and (ImgDepth = 32) then
begin
 ....
 ....
 TmpPixBuf := gdk_pixbuf_new_from_data(Data, GDK_COLORSPACE_RGB, True, 8, ImgWidth ...)

Alpha parameter is incorrect. With this example if it's FALSE then everything works ok under gtk and gtk2 (but then images with real alpha does not work).
So we must find if data really have valid alpha or not.

Luiz Americo

2010-12-13 18:39

developer   ~0044209

Currently, blitting bitmaps contexts with and without alpha transparency are handled in the same function.

My suggestion is to improve granularity and add a separated function to blit alpha bitmaps

Zeljan Rikalo

2012-02-03 11:23

developer   ~0056282

added gtk2 ws too since it's reproducable under gtk2

Marc Weustink

2012-02-06 09:45

administrator   ~0056563

So this means that the gdk_pixbuf_new_from_data function is broken when an alpha image is provided ?

Zeljan Rikalo

2012-02-06 11:01

developer   ~0056573

Last edited: 2012-02-06 11:33

Just tested with r35170 and it does not work under gtk and gtk2.
qt works fine and win32 under wine is ok too.
So, answer to your question is YES. My comment about alpha is still valid for both gtk and gtk2.
UPDATE: There's NO CRASH, but it doesn't draw anything (just tested attached example), setting alpha param to False fixes problem, but other normal images are mostly black.

Zeljan Rikalo

2012-02-06 12:18

developer   ~0056574

Please test and close if ok. That bug comes from GdkPixbuf which doesn't like creating new pixbuf from data when dataSize / maskSize < 32 (for pf32bit).eg. this one was 31.57

Issue History

Date Modified Username Field Change
2007-03-19 15:56 Luiz Americo New Issue
2007-03-19 15:56 Luiz Americo File Added: BitBltGTK.zip
2007-03-19 15:56 Luiz Americo Widgetset => GTK
2007-03-19 22:52 Vincent Snijders LazTarget => 1.0
2007-03-19 22:52 Vincent Snijders Status new => acknowledged
2008-04-24 09:57 Vincent Snijders Target Version => 1.0.0
2009-06-01 20:32 Marc Weustink Status acknowledged => assigned
2009-06-01 20:32 Marc Weustink Assigned To => Marc Weustink
2010-11-30 10:35 Vincent Snijders Note Added: 0043776
2010-11-30 10:35 Vincent Snijders Status assigned => feedback
2010-11-30 10:50 Anton Kavalenka Note Added: 0043779
2010-11-30 10:56 Anton Kavalenka Note Edited: 0043779
2010-11-30 10:57 Zeljan Rikalo Note Added: 0043782
2010-11-30 10:58 Anton Kavalenka Note Edited: 0043779
2010-11-30 11:08 Zeljan Rikalo Note Added: 0043784
2010-11-30 11:23 Zeljan Rikalo Note Added: 0043787
2010-11-30 11:27 Zeljan Rikalo Note Edited: 0043787
2010-12-13 18:39 Luiz Americo Note Added: 0044209
2011-03-31 10:47 Vincent Snijders Status feedback => assigned
2012-02-03 11:23 Zeljan Rikalo Widgetset GTK => GTK, GTK 2
2012-02-03 11:23 Zeljan Rikalo Note Added: 0056282
2012-02-06 09:45 Marc Weustink Note Added: 0056563
2012-02-06 11:01 Zeljan Rikalo Note Added: 0056573
2012-02-06 11:01 Zeljan Rikalo Status assigned => feedback
2012-02-06 11:33 Zeljan Rikalo Note Edited: 0056573
2012-02-06 12:14 Zeljan Rikalo Status feedback => assigned
2012-02-06 12:14 Zeljan Rikalo Assigned To Marc Weustink => Zeljan Rikalo
2012-02-06 12:18 Zeljan Rikalo Fixed in Revision => 35177
2012-02-06 12:18 Zeljan Rikalo Status assigned => resolved
2012-02-06 12:18 Zeljan Rikalo Resolution open => fixed
2012-02-06 12:18 Zeljan Rikalo Note Added: 0056574
2012-02-21 14:13 Luiz Americo Status resolved => closed