Accepting request 400780 from GNOME:Next

1

OBS-URL: https://build.opensuse.org/request/show/400780
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/librsvg?expand=0&rev=104
This commit is contained in:
Dominique Leuenberger 2016-06-09 09:01:24 +00:00 committed by Git OBS Bridge
parent ccc1a4df3f
commit 093501dc02
5 changed files with 19 additions and 112 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9cac4a123eec6e553a26e120979bab7425def9ae7ce7c079eba5e4a45db05f4
size 554608

3
librsvg-2.40.16.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d48bcf6b03fa98f07df10332fb49d8c010786ddca6ab34cbba217684f533ff2e
size 560800

View File

@ -1,105 +0,0 @@
From 7db196eae60cc0dbbe3a262429bfecac3936c5b9 Mon Sep 17 00:00:00 2001
From: Menner <mik@gmx.org>
Date: Mon, 4 Apr 2016 13:15:44 -0500
Subject: bgo#760262: rsvg-convert: Actually scale the image if required
Commit fecfcce44a959daff80a4e0f9ced83d7cdcb5903 removed a call to the deprecated function
rsvg_handle_set_size_callback(), but this is what actually made the program scale
the resulting image if required. Here we use a Cairo transformation matrix instead.
https://bugzilla.gnome.org/show_bug.cgi?id=760262
Based on a patch by Menner <mik@gmx.org>
---
rsvg-convert.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/rsvg-convert.c b/rsvg-convert.c
index 2befdff..1e3ed05 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -140,6 +140,8 @@ main (int argc, char **argv)
RsvgDimensionData dimensions;
FILE *output_file = stdout;
char *export_lookup_id;
+ double unscaled_width, unscaled_height;
+ int scaled_width, scaled_height;
#ifdef G_OS_WIN32
HANDLE handle;
@@ -319,6 +321,9 @@ main (int argc, char **argv)
if (!rsvg_handle_get_dimensions_sub (rsvg, &dimensions, export_lookup_id))
g_printerr ("Could not get dimensions for file %s\n", args[i]);
+ unscaled_width = dimensions.width;
+ unscaled_height = dimensions.height;
+
/* if both are unspecified, assume user wants to zoom the image in at least 1 dimension */
if (width == -1 && height == -1) {
size_data.type = RSVG_SIZE_ZOOM;
@@ -348,20 +353,22 @@ main (int argc, char **argv)
size_data.keep_aspect_ratio = keep_aspect_ratio;
}
- _rsvg_size_callback (&dimensions.width, &dimensions.height, &size_data);
+ scaled_width = dimensions.width;
+ scaled_height = dimensions.height;
+ _rsvg_size_callback (&scaled_width, &scaled_height, &size_data);
if (!format || !strcmp (format, "png"))
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- dimensions.width, dimensions.height);
+ scaled_width, scaled_height);
#ifdef CAIRO_HAS_PDF_SURFACE
else if (!strcmp (format, "pdf"))
surface = cairo_pdf_surface_create_for_stream (rsvg_cairo_write_func, output_file,
- dimensions.width, dimensions.height);
+ scaled_width, scaled_height);
#endif
#ifdef CAIRO_HAS_PS_SURFACE
else if (!strcmp (format, "ps") || !strcmp (format, "eps")){
surface = cairo_ps_surface_create_for_stream (rsvg_cairo_write_func, output_file,
- dimensions.width, dimensions.height);
+ scaled_width, scaled_height);
if(!strcmp (format, "eps"))
cairo_ps_surface_set_eps(surface, TRUE);
}
@@ -369,13 +376,13 @@ main (int argc, char **argv)
#ifdef CAIRO_HAS_SVG_SURFACE
else if (!strcmp (format, "svg"))
surface = cairo_svg_surface_create_for_stream (rsvg_cairo_write_func, output_file,
- dimensions.width, dimensions.height);
+ scaled_width, scaled_height);
#endif
#ifdef CAIRO_HAS_XML_SURFACE
else if (!strcmp (format, "xml")) {
cairo_device_t *device = cairo_xml_create_for_stream (rsvg_cairo_write_func, output_file);
surface = cairo_xml_surface_create (device, CAIRO_CONTENT_COLOR_ALPHA,
- dimensions.width, dimensions.height);
+ scaled_width, scaled_height);
cairo_device_destroy (device);
}
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE (1, 10, 0)
@@ -400,7 +407,7 @@ main (int argc, char **argv)
((background_color >> 16) & 0xff) / 255.0,
((background_color >> 8) & 0xff) / 255.0,
((background_color >> 0) & 0xff) / 255.0);
- cairo_rectangle (cr, 0, 0, dimensions.width, dimensions.height);
+ cairo_rectangle (cr, 0, 0, scaled_width, scaled_height);
cairo_fill (cr);
}
@@ -416,6 +423,9 @@ main (int argc, char **argv)
cairo_translate (cr, -pos.x, -pos.y);
}
+ cairo_scale (cr,
+ scaled_width / unscaled_width,
+ scaled_height / unscaled_height);
rsvg_handle_render_cairo_sub (rsvg, cr, export_lookup_id);
g_free (export_lookup_id);
--
cgit v0.12

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Thu Jun 9 08:47:24 UTC 2016 - zaitor@opensuse.org
- Update to version 2.40.16:
+ Support for building the introspection files under MSVC.
+ Make the zooming options in rsvg-convert(1) work again for
scaling the resulting image (bgo#760262).
+ Wikipedia generates equations as SVGs and renders them, but
uses fill="currentColor". Since we don't let caller specify a
starting state for CSS, we need to start with opaque black as
the default current color (bgo#764808).
+ Added documentation for how to replace the deprecated
rsvg_handle_set_size_callback().
- Drop librsvg-Fix-rsvg-convert.patch: Fixed upstream.
-------------------------------------------------------------------
Mon Apr 18 11:18:56 UTC 2016 - zaitor@opensuse.org

View File

@ -17,7 +17,7 @@
Name: librsvg
Version: 2.40.15
Version: 2.40.16
Release: 0
Summary: A Library for Rendering SVG Data
License: LGPL-2.0+ and GPL-2.0+
@ -25,8 +25,6 @@ Group: System/Libraries
Url: http://librsvg.sourceforge.net/
Source: http://download.gnome.org/sources/librsvg/2.40/%{name}-%{version}.tar.xz
Source99: baselibs.conf
# PATCH-FIX-UPSTREAM librsvg-Fix-rsvg-convert.patch bgo#760262 zaitor@opensuse.org -- Actually scale the image if required, regression fix.
Patch0: librsvg-Fix-rsvg-convert.patch
BuildRequires: gobject-introspection-devel
BuildRequires: vala
# Avoid cycle: we do not require the adwaita-icon-theme to be present. libgtk-3.0 requires this for end users
@ -122,7 +120,6 @@ http://www.w3c.org).
%prep
%setup -q
%patch0 -p1
%build
%configure\