Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 880228 Details for
Bug 920531
media-gfx/gimp-2.99.16 depends now on >=gnome-base/librsvg-2.46
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
colorsvg2png.c for gimp-2.99.10 that allow to compile with libsrvg-2.40
colorsvg2png.c (text/x-csrc), 2.31 KB, created by
Francois Chenier
on 2023-12-22 10:35:23 UTC
(
hide
)
Description:
colorsvg2png.c for gimp-2.99.10 that allow to compile with libsrvg-2.40
Filename:
MIME Type:
Creator:
Francois Chenier
Created:
2023-12-22 10:35:23 UTC
Size:
2.31 KB
patch
obsolete
>/* colorsvg2png.c > * Copyright (C) 2018 Jehan > * > * This program is free software: you can redistribute it and/or modify > * it under the terms of the GNU General Public License as published by > * the Free Software Foundation; either version 3 of the License, or > * (at your option) any later version. > * > * This program is distributed in the hope that it will be useful, > * but WITHOUT ANY WARRANTY; without even the implied warranty of > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > * GNU General Public License for more details. > * > * You should have received a copy of the GNU General Public License > * along with this program. If not, see <https://www.gnu.org/licenses/>. > */ > >#include <glib/gprintf.h> >#include <librsvg/rsvg.h> > >int >main (int argc, char **argv) >{ > GError *error = NULL; > RsvgHandle *handle; > cairo_surface_t *surface; > cairo_t *cr; > RsvgDimensionData original_dim; > > gchar *input; > gchar *output; > gint dim; > > if (argc != 4) > { > g_fprintf (stderr, "Usage: colorsvg2png svg-image png-output size\n"); > return 1; > } > > input = argv[1]; > output = argv[2]; > dim = (gint) g_ascii_strtoull (argv[3], NULL, 10); > if (dim < 1) > { > g_fprintf (stderr, "Usage: invalid dimension %d\n", dim); > return 1; > } > > handle = rsvg_handle_new_from_file (input, &error); > if (! handle) > { > g_fprintf (stderr, > "Error: failed to load '%s' as SVG: %s\n", > input, error->message); > g_error_free (error); > return 1; > } > > surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dim, dim); > cr = cairo_create (surface); > rsvg_handle_get_dimensions (handle, &original_dim); > cairo_surface_destroy (surface); > cairo_scale (cr, > (gdouble) dim / (gdouble) original_dim.width, > (gdouble) dim / (gdouble) original_dim.height); > > if (! rsvg_handle_render_cairo (handle, cr)) > { > g_fprintf (stderr, > "Error: failed to render '%s'\n", > input); > return 1; > } > > if (cairo_surface_write_to_png (surface, output) != CAIRO_STATUS_SUCCESS) > { > g_fprintf (stderr, > "Error: failed to write '%s'\n", > output); > return 1; > } > cairo_destroy (cr); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 920531
: 880228 |
880229
|
886557
|
886558