Bug 174027 - GTK printing doesn't work when drawing images
Summary: GTK printing doesn't work when drawing images
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-13 12:14 EST by Elfi Heck CLA
Modified: 2016-08-18 16:03 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elfi Heck CLA 2007-02-13 12:14:14 EST
I'm using the new GTK printing code that's in 3.3 (3.3M5). This works well except when I try to use the drawImage() method with the printer gc. In this case printing fails silently (no exceptions, no output).
I'm on Ubuntu 6.10 which has libcairo2 1.2.4. I can't test another distribution right now but will do so in the next few days (there's another bug with drawImage that occurs with cairo 1.2 only, so maybe this is dependent on the cairo version too).

Having this fixed would be quite important for us since we're planning to ship the Linux version of our product (a PDF editor) in March. I can't explain to a potential customer that she will be able to print on Windows but not on Linux.
Comment 1 Steve Northover CLA 2007-02-13 14:09:05 EST
Carolyn, we've seen images print before, right?  Sounds like a bug/feature in the version of cairo they are using.
Comment 2 Elfi Heck CLA 2007-03-05 12:14:57 EST
Found out now that the problem doesn't occur when the image in question has alpha data. I suspect the cairo_xlib_surface_create that is done for an image without alpha in Image.createSurface() is the culprit. Seems as if the pattern later created from the xlib surface and the printer surface it's to be painted on don't get along.
The obvious workaround is to initialize alphaData to an all -1 byte array.
Comment 3 Steve Northover CLA 2007-03-05 22:38:47 EST
CAR, can you and SSQ confirm this work around?
Comment 4 Carolyn MacLeod CLA 2007-03-13 12:41:30 EDT
Just curious - by any chance does it work ok when it's a PNG24 image, as mentioned in bug 174714 ?
Comment 5 Elfi Heck CLA 2007-03-13 13:28:46 EDT
I can print the image from #174714 just fine with the latest SWT.
This image has transparentPixel set to 0. I'm only seeing the problem described here when an image has no transparency at all i.e. the "else" branch just at the end of Image.createSurface() is reached. And I never get garbled images in that case; the printer simply won't print the page.
You might ask the other reporter for his cairo version. As I said, I have 1.2.4 and don't see the other problem.
Comment 6 Eric Williams CLA 2016-08-18 16:03:55 EDT
(In reply to Elfi Heck from comment #5)
> I can print the image from #174714 just fine with the latest SWT.

Based on this, closing.