[GRASS-dev] ERROR: Cairo_draw_bitmap: Failed to create source

Markus Neteler neteler at osgeo.org
Sun Aug 16 04:07:29 EDT 2009


On Sun, Aug 16, 2009 at 7:01 AM, Glynn Clements<glynn at gclements.plus.com> wrote:
> Markus Neteler wrote:
>
>> I am trying to render PDFs from screen output (6.5, for 7 see below) and ran
>> into this error:
>>
>> # minimalistic example
>> d.erase
>> echo "Ciao" | d.text at=15,92 -b size=4 font=Vera
>>
>> d.out.file output format=pdf
>> Using the Cairo driver.
>> Saving display from Monitor: [x0] to <output.pdf>.
>> Image size [1276 x 966]
>> ERROR: Cairo_draw_bitmap: Failed to create source
>
> Can you run "nm -D" on libgrass_cairodriver.so and report whether the
> symbol cairo_format_stride_for_width appears in the output?

[neteler at localhost ~]$ nm -D
/home/neteler/grass64/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
[neteler at localhost ~]$ nm -D
/home/neteler/grass65/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
[neteler at localhost ~]$ nm -D
/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/lib/libgrass_cairodriver.so
| grep cairo_format_stride_for_width
                 U cairo_format_stride_for_width

[neteler at localhost ~]$ grep cairo_format_stride_for_width
grass64/lib/cairodriver/*
[neteler at localhost ~]$ grep cairo_format_stride_for_width
grass65/lib/cairodriver/*
[neteler at localhost ~]$ grep cairo_format_stride_for_width
grass70/lib/cairodriver/*
grass70/lib/cairodriver/Draw_bitmap.c:    stride =
cairo_format_stride_for_width(CAIRO_FORMAT_A8, ncols);

So, only in 7.

> That function requires cairo 1.5.8 or later.

I have (64bit)
rpm -qa | grep cairo
lib64cairomm1.0_1-1.8.0-1mdv2009.1
lib64cairo2-1.8.6-3mdv2009.1
python-cairo-1.8.2-1mdv2009.1
lib64cairo-devel-1.8.6-3mdv2009.1
libcairo2-1.8.6-3mdv2009.1

> On earlier versions, the
> stride is forced to be a multiple of 4; it may be that it needs to be
> a multiple of 8 on a 64-bit platform.
>
>> GRASS 7 - no success at all:
>>
>> export GRASS_RENDER_IMMEDIATE=CAIRO
>> export GRASS_PNGFILE=map.pdf
>> d.rast map=elevation.10m
>>  100%
>> ERROR: write_image: unknown file type: .pdf
>
> That error message is from the PNG driver, which implies that GRASS
> was built without cairo support.

Actually, I compiled with cairo support:

grep cairo grass70/conf_grass70_64bit_pentium.sh
  --with-cairo \

grep cairo grass70/include/Make/*
grass70/include/Make/Grass.make:CAIRODRIVER_LIBNAME   = grass_cairodriver
grass70/include/Make/Platform.make:#cairo
grass70/include/Make/Platform.make:CAIROINC                  =
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12
grass70/include/Make/Platform.make:CAIROLIB                  = -lcairo
-lfreetype -lfontconfig
grass70/include/Make/Platform.make.in:#cairo

Markus


More information about the grass-dev mailing list