Opened 14 years ago
Closed 13 years ago
#1152 closed defect (fixed)
d.out.file + cairo: errors writing the image
Reported by: | hamish | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 6.4.1 |
Component: | Display | Version: | unspecified |
Keywords: | d.out.file, cairo | Cc: | |
CPU: | All | Platform: | All |
Description
Hi,
in 6.4/6.5svn d.out.file with -c for the Cairo driver is having problems writing to the file. ISTR this was discussed on the ML recently, with the explanation something like that d.mon start=
returns without waiting?
G65> d.out.file -c landsat Saving display from Monitor: [x0] to <landsat.png>. Image size [1115 x 988] 100% ERROR: Cairo_draw_bitmap: Failed to create source WARNING: Socket is already in use or not accepting connections. WARNING: Use d.mon to select a monitor ERROR: No graphics device selected WARNING: Error - Monitor 'cairo' was not running Screen export complete. (writing the file may take a small amount of time) Image crop [1115 x 987] Done.
the image is a large (7000x8000) raster with a d.grid and d.text decorations over the top of it. I tried pushing in a sleep 1
before each d.* command from d.save, but no luck.
on a simple low-res image it does fine, as does running with the regular PNG driver. same behavior on multiple machines & different linux distros. (deb/ubu)
perhaps the solution is setting one of the display driver direct rendering enviro variables?
?
thanks, Hamish
Attachments (1)
Change History (13)
follow-up: 2 comment:1 by , 14 years ago
follow-ups: 3 6 comment:2 by , 14 years ago
Replying to hamish:
using
sync
instead ofsleep
seems to work
That's sheer coincidence. "sync" waits for modified blocks to be written to disk. This could take several seconds, or it could return immediately.
In this case, the problem is:
ERROR: Cairo_draw_bitmap: Failed to create source
The monitor process is terminating via G_fatal_error(). Once that happens, subsequent d.* commands will fail however long you wait. Using GRASS_RENDER_IMMEDIATE=TRUE will prevent this (the command provoking the error will fail, but subsequent commands will succeed), but that's a workaround. The fix is to sync the cairo driver to 7.0, where the issue has been fixed.
by , 14 years ago
Attachment: | 65to7_cairo.diff.bz2 added |
---|
diff between 6.5 and trunk lib/cairodriver/
follow-up: 4 comment:3 by , 14 years ago
Keywords: | d.out.file added; d out.file removed |
---|
comment:4 by , 14 years ago
Replying to hamish:
The fix is to sync the cairo driver to 7.0, where the issue has been fixed.
erm, the whole thing? (attached diff is 50k without the new files)
No; the 7.0 version won't work as-is in 6.x due to the substantial changes to the graphics architecture.
I mean: modify lib/cairodriver/Draw_bitmap.c so that it resembles the version in 7.0, but not so much that it doesn't compile or run.
follow-up: 7 comment:6 by , 14 years ago
CPU: | x86-64 → All |
---|---|
Platform: | Linux → All |
follow-ups: 8 9 comment:7 by , 14 years ago
Replying to glynn:
Replying to glynn: BTW, this is a duplicate of #1123 (which I've closed as "duplicate", as this one has more content).
ok, thanks. for the record the test case given in #1123 is the best way I know to trigger the bug. I've just tested in 6.5svn+the backported fix and it works, while relbr6.4 fails (as expected).
if someone else could test the 6.5svn version on another platforms (i.e. Mac and WinGrass) we can backport it to 6.4 as well.
I guess WinGrass users might have to select cairo mode from the wx GUI preferences?
Hamish
comment:8 by , 14 years ago
Replying to hamish:
Replying to glynn:
Replying to glynn: BTW, this is a duplicate of #1123 (which I've closed as "duplicate", as this one has more content).
ok, thanks. for the record the test case given in #1123 is the best way I know to trigger the bug. I've just tested in 6.5svn+the backported fix and it works, while relbr6.4 fails (as expected).
if someone else could test the 6.5svn version on another platforms (i.e. Mac and WinGrass) we can backport it to 6.4 as well.
I guess WinGrass users might have to select cairo mode from the wx GUI preferences?
Hamish
AFAIK there's no cairo-support in WinGrass at the moment (see http://trac.osgeo.org/osgeo4w/ticket/72).
Helmut
follow-up: 10 comment:9 by , 14 years ago
follow-up: 11 comment:10 by , 14 years ago
follow-up: 12 comment:11 by , 13 years ago
comment:12 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
using
sync
instead ofsleep
seems to work, but I doubt it is the best solution or portable to MSys.