|
|
|
@ -148,8 +148,31 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) |
|
|
|
goto done; |
|
|
|
|
|
|
|
RsvgDimensionData dim; |
|
|
|
rsvg_handle_get_dimensions( rsvg, &dim ); |
|
|
|
#if LIBRSVG_MAJOR_VERSION > 2 || ( LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52 ) |
|
|
|
gboolean has_width, has_height, has_viewbox; |
|
|
|
RsvgLength width, height; |
|
|
|
RsvgRectangle viewbox; |
|
|
|
|
|
|
|
rsvg_handle_get_intrinsic_dimensions( rsvg, &has_width, &width, &has_height, &height, &has_viewbox, &viewbox ); |
|
|
|
|
|
|
|
if( has_width && has_height && width.unit == RSVG_UNIT_PX && height.unit == RSVG_UNIT_PX ) |
|
|
|
{ |
|
|
|
dim.width = (int) width.length; |
|
|
|
dim.height = (int) height.length; |
|
|
|
} |
|
|
|
else if( has_viewbox ) |
|
|
|
{ |
|
|
|
dim.width = (int) viewbox.width; |
|
|
|
dim.height = (int) viewbox.height; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
dim.width = 0; |
|
|
|
dim.height = 0; |
|
|
|
} |
|
|
|
#else |
|
|
|
rsvg_handle_get_dimensions( rsvg, &dim ); |
|
|
|
#endif |
|
|
|
if( p_sys->f_scale > 0.0 ) |
|
|
|
{ |
|
|
|
i_width = (int32_t)(p_sys->f_scale * dim.width); |
|
|
|
|