Wind River Support Network

HomeDefectsLIN6-12291
Fixed

LIN6-12291 : The package cairo unexpectedly generates PNG formatted graphics instead of SVG formatted graphics

Created: Jan 23, 2017    Updated: Dec 3, 2018
Resolved Date: Feb 7, 2017
Found In Version: 6.0.0.32
Fix Version: 6.0.0.33
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Userspace

Description

The version of cairo in WRL6 package set is 1.12.14. For execution of generating SVG formatted graphics with cairo-1.12.14, the result of it is that PNG formatted graphics is generated.

Steps to Reproduce

1. Create and build a new platform project.
2. Create a new application project, and do the following steps.
  - Add the test C source file to the project. The code of the test C source file is attached to the bottom of this field.
 - Set LIBPATH in Valiables in Properties of the project as the following string value.

<Platform Projec dir>/bitbake_build/tmp/work/x86_64-wrs-linux/cairo/1.12.14-r0/sysroot-destdir/usr/lib64/libcairo.so

3. Build the application project, and execute the executable binary of it on the target.

4. For executing the binary, test.svg is generated. And, it contains the following PNG formatted data, and it does not contains SVG formatted data.

<image id="image7" width="400" height="300" xlink:href="data:image/png;base64,iVBORw0KGgo........."/>



/** test case **/
#include <cairo/cairo.h>
#include <cairo/cairo-svg.h>
#include <stdio.h>

int main()
    {
    cairo_surface_t* pclSurface = cairo_svg_surface_create("./test.svg", 1920, 1200);
    cairo_t* pclCairo = cairo_create(pclSurface);

    cairo_surface_t *pclStreamSurface = cairo_svg_surface_create_for_stream( NULL, NULL, 400, 300 );
    cairo_t *pclStreamCairo = cairo_create( pclStreamSurface );
    cairo_set_source_rgb( pclStreamCairo, 255/255.0, 128/255.0, 33/255.0 );
    cairo_paint( pclStreamCairo );
    cairo_set_source_surface( pclCairo, pclStreamSurface, 0.0, 0.0 );
    cairo_paint( pclCairo );

    cairo_show_page( pclStreamCairo );

    cairo_destroy( pclStreamCairo );
    cairo_surface_destroy( pclStreamSurface );
    cairo_destroy(pclCairo);
    cairo_surface_destroy(pclSurface);

    return 0;
    }

Other Downloads


Live chat
Online