--- gimp-3.0.2.old/plug-ins/common/file-svg.c +++ gimp-3.0.2/plug-ins/common/file-svg.c @@ -74,7 +74,6 @@ static GimpProcedure * svg_create_procedure (GimpPlugIn *plug_in, const gchar *name); -static GimpUnit * svg_rsvg_to_gimp_unit (RsvgUnit unit); static gboolean svg_extract (GimpProcedure *procedure, GimpRunMode run_mode, GFile *file, @@ -198,32 +197,6 @@ return procedure; } -static GimpUnit * -svg_rsvg_to_gimp_unit (RsvgUnit unit) -{ - switch (unit) - { - case RSVG_UNIT_PERCENT: - return gimp_unit_percent (); - case RSVG_UNIT_PX: - return gimp_unit_pixel (); - case RSVG_UNIT_IN: - return gimp_unit_inch (); - case RSVG_UNIT_MM: - return gimp_unit_mm (); - case RSVG_UNIT_PT: - return gimp_unit_point (); - case RSVG_UNIT_PC: - return gimp_unit_pica (); - case RSVG_UNIT_CM: - case RSVG_UNIT_EM: - case RSVG_UNIT_EX: - /*case RSVG_UNIT_CH:*/ - default: - return NULL; - } -} - static gboolean svg_extract (GimpProcedure *procedure, GimpRunMode run_mode, @@ -411,12 +384,18 @@ } } #else - rsvg_handle_get_dimensions (handle, &dim); - extracted_dimensions->width = (gdouble) dim.width; - extracted_dimensions->height = (gdouble) dim.height; + extracted_dimensions->width = 512; + extracted_dimensions->height = 512; extracted_dimensions->exact_width = FALSE; extracted_dimensions->exact_height = FALSE; extracted_dimensions->correct_ratio = TRUE; + extracted_dimensions->exact_density = TRUE; + extracted_dimensions->correct_ratio = TRUE; + extracted_dimensions->width_unit = gimp_unit_pixel(); + extracted_dimensions->height_unit = gimp_unit_pixel(); + + /* Honestly at this point, setting 300 PPI is random. */ + rsvg_handle_set_dpi (handle, 300.0); #endif } } @@ -684,7 +663,7 @@ vals.resolution = resolution; vals.width = width; vals.height = height; - rsvg_handle_set_size_callback (handle, load_set_size_callback, vals, NULL); + rsvg_handle_set_size_callback (handle, load_set_size_callback, (void *) &vals, NULL); pixbuf = rsvg_handle_get_pixbuf (handle); #endif