Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 920531 | Differences between
and this patch

Collapse All | Expand All

(-)gimp-2.99.16/tools/colorsvg2png.c.old (-14 / +11 lines)
Lines 25-36 Link Here
25
  RsvgHandle        *handle;
25
  RsvgHandle        *handle;
26
  cairo_surface_t   *surface;
26
  cairo_surface_t   *surface;
27
  cairo_t           *cr;
27
  cairo_t           *cr;
28
  RsvgRectangle      target_rect;
28
  RsvgDimensionData  original_dim;
29
29
30
  gchar             *input;
30
  gchar             *input;
31
  gchar             *output;
31
  gchar             *output;
32
  gint               dim;
32
  gint               dim;
33
  gint               retval = 0;
34
33
35
  if (argc != 4)
34
  if (argc != 4)
36
    {
35
    {
Lines 59-88 Link Here
59
58
60
  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dim, dim);
59
  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dim, dim);
61
  cr = cairo_create (surface);
60
  cr = cairo_create (surface);
61
  rsvg_handle_get_dimensions (handle, &original_dim);
62
  cairo_surface_destroy (surface);
63
  cairo_scale (cr,
64
               (gdouble) dim / (gdouble) original_dim.width,
65
               (gdouble) dim / (gdouble) original_dim.height);
62
66
63
  target_rect.x = target_rect.y = 0;
67
  if (! rsvg_handle_render_cairo (handle, cr))
64
  target_rect.width = target_rect.height = dim;
65
66
  if (! rsvg_handle_render_document (handle, cr, &target_rect, NULL))
67
    {
68
    {
68
      g_fprintf (stderr,
69
      g_fprintf (stderr,
69
                 "Error: failed to render '%s'\n",
70
                 "Error: failed to render '%s'\n",
70
                 input);
71
                 input);
71
      retval = 1;
72
      return 1;
72
    }
73
    }
73
74
74
  if (retval == 0 &&
75
  if (cairo_surface_write_to_png (surface, output) != CAIRO_STATUS_SUCCESS)
75
      cairo_surface_write_to_png (surface, output) != CAIRO_STATUS_SUCCESS)
76
    {
76
    {
77
      g_fprintf (stderr,
77
      g_fprintf (stderr,
78
                 "Error: failed to write '%s'\n",
78
                 "Error: failed to write '%s'\n",
79
                 output);
79
                 output);
80
      retval = 1;
80
      return 1;
81
    }
81
    }
82
83
  cairo_surface_destroy (surface);
84
  cairo_destroy (cr);
82
  cairo_destroy (cr);
85
  g_object_unref (handle);
86
83
87
  return retval;
84
  return 0;
88
}
85
}

Return to bug 920531