GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 38e87c2d authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Michael Natterer

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.

(cherry picked from commit b2027c40)
parent 8d609ecf
......@@ -521,19 +521,24 @@ 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);
rsvg_handle_get_dimensions (handle, &dim);
if (dim.width > 0 && dim.height > 0)
if (success)
{
vals->width = dim.width;
vals->height = dim.height;
rsvg_handle_get_dimensions (handle, &dim);
if (dim.width > 0 && dim.height > 0)
{
vals->width = dim.width;
vals->height = dim.height;
done = TRUE;
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