Commit b2027c40 authored by Federico Mena Quintero's avatar Federico Mena Quintero

Issue #2561: Fix computation of SVG image sizes

The librsvg API was being called in an incorrect order.  One cannot
call rsvg_handle_get_dimensions() until after rsvg_handle_close() is
done.
parent 6bb03dc2
......@@ -521,10 +521,9 @@ load_rsvg_size (const gchar *filename,
break;
case G_IO_STATUS_EOF:
success = rsvg_handle_close (handle, error);
break;
case G_IO_STATUS_NORMAL:
success = rsvg_handle_write (handle,
(const guchar *) buf, len, error);
if (success)
{
rsvg_handle_get_dimensions (handle, &dim);
if (dim.width > 0 && dim.height > 0)
......@@ -534,6 +533,12 @@ load_rsvg_size (const gchar *filename,
done = TRUE;
}
}
break;
case G_IO_STATUS_NORMAL:
success = rsvg_handle_write (handle,
(const guchar *) buf, len, error);
break;
case G_IO_STATUS_AGAIN:
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment