After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 147662 - Gimp shouldn't use deprecated RSVG APIs
Gimp shouldn't use deprecated RSVG APIs
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal trivial
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-15 16:44 UTC by Damien Carbery
Modified: 2005-05-02 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change svg.c to match function prototype change in librsvg (926 bytes, patch)
2004-07-15 16:45 UTC, Damien Carbery
needs-work Details | Review

Description Damien Carbery 2004-07-15 16:44:31 UTC
plug-ins/common/svg.c calls rsvg_handle_set_dpi from librsvg/rsvg.h.
A commit of rsvg.h on July 10 changed  rsvg_handle_set_dpi:

-void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
+void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi_x,
double dpi_y);

svg.c therefore fails to compile on Solaris, with a prototype mismatch error:
"svg.c", line 373: prototype mismatch: 2 args passed, 3 expected
"svg.c", line 469: prototype mismatch: 2 args passed, 3 expected

Attached patch changes vals->resolution to vals->width and vals->height though
this may not be the correct thing to do (though it now compiles on my Solaris
systems).
Comment 1 Damien Carbery 2004-07-15 16:45:20 UTC
Created attachment 29558 [details] [review]
Change svg.c to match function prototype change in librsvg
Comment 2 Sven Neumann 2004-07-15 17:43:14 UTC
The librsvg developers should be more careful and should avoid changing the API.
It looks like the change is in CVS only and not in a released version. It also
looks as if the version number hasn't been increased when this API change was
made. We can thus not do anything about it.

I am reassigning this GIMP bug-report to librsvg. I suggest that the API change
is reverted and instead a new function is added that allows to change the
horizontal and vertical resolutions independently.
Comment 3 Dominic Lachowicz 2004-07-17 17:05:29 UTC
API change reverted, new function added. as far as i know, librsvg is part of
the "desktop" platform and thus has no guarantee of API/ABI stability. but i'll
bend here.

old APIs marked as deprecated. reassigning bug to GIMP to not use deprecated APIs.
Comment 4 Sven Neumann 2004-07-17 22:50:26 UTC
Well, we can hardly depend on an unreleased version of librsvg but we could use
the new API conditionally.for GIMP 2.2.
Comment 5 Dave Neary 2004-08-09 14:20:28 UTC
Comment on attachment 29558 [details] [review]
Change svg.c to match function prototype change in librsvg

The patch needs to test against the rsvg version installed, and use the new API
conditionally.
Comment 6 Sven Neumann 2004-09-16 18:27:36 UTC
This sucks. If we use the new API conditionally we make it impossible to use the
binary which is compiled against a newer version of librsvg on a machine where
an older version is installed. We will postpone this change until the new API is
commonly available.
Comment 7 weskaggs 2005-03-21 21:49:04 UTC
Would it be okay to fix this by adding a configure check for the librsvg
version?  I'll be happy to code it up if that is acceptable.
Comment 8 Manish Singh 2005-03-21 22:29:31 UTC
Uh, this is a one line change to configure.in (change rsvg_required_version to
version number where the new API was introduced)
Comment 9 weskaggs 2005-03-21 23:19:28 UTC
If we took that approach, it would mean requiring at minimum librsvg 2.8, which
was released September 2004.  Would that be acceptable?
Comment 10 Manish Singh 2005-03-21 23:32:04 UTC
That's the approach Sven suggested. I think it's fine for HEAD.
Comment 11 Michael Natterer 2005-03-21 23:34:54 UTC
Yea, we also require GTK 2.6, which was released much later.
Comment 12 weskaggs 2005-03-22 17:10:43 UTC
In HEAD:

2005-03-22  Bill Skaggs  <weskaggs@primate.ucdavis.edu>

	* configure.in: raise required librsvg version to 2.8.0
	* plug-ins/common/svg.c: change deprecated librsvg api,
	fixes bug #147662.
Comment 13 Pär Forsling 2005-05-02 15:47:22 UTC
FYI, they have changed name of rsvg_handle_set_dpi_x_y back to
rsvg_handle_set_dpi in cvs.
Comment 14 Sven Neumann 2005-05-02 18:59:55 UTC
Does that mean that the plug-in doesn't compile against current CVS of librsvg then?