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 314400 - rsvg_handle_set_dpi_x_y( ) is required to build gimp-2.3.3
rsvg_handle_set_dpi_x_y( ) is required to build gimp-2.3.3
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other Linux
: Urgent normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
: 316719 316799 320148 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-24 16:06 UTC by Joseph Sacco
Modified: 2005-12-19 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
handle API change in GIMP plug-in (947 bytes, patch)
2005-08-25 17:23 UTC, Sven Neumann
none Details | Review
patch gimp-2.3.3 to build using librsvg-2.9.9 (1.40 KB, patch)
2005-08-25 20:09 UTC, Joseph Sacco
none Details | Review
Patch against 2.3.5 GIMP to work around for librsvg versions {2.11.0, 2.13.0, 2.13.1, 2.13.2} (944 bytes, patch)
2005-12-16 11:05 UTC, Mukund Sivaraman
none Details | Review
patch that I am going to apply to both branches (2.06 KB, patch)
2005-12-19 12:33 UTC, Sven Neumann
committed Details | Review

Description Joseph Sacco 2005-08-24 16:06:16 UTC
Version details: CVS as of 10Aug05
Distribution/Version: YDL-4.0.1

The latest version of gimp, 2.3.3, will not link against the 10Aug05 CVS version
of librsvg.

I see from the CVS source code that the librsvg team is in the process of
deciding what to do with an entire set  of "RSVG_DISABLE_DEPRECATED" functions.

In version 2.9.5, that set contained only two functions,

   #ifndef RSVG_DISABLE_DEPRECATED
   void        rsvg_set_default_dpi          (double dpi);
   void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
   #endif

rsvg_handle_set_dpi_x_y() was not[yet] a member of that set.

As the librsvg API continues to evolve, it would be prudent to publish
anticipated API changes well in advance of release so other development groups
can incorporate them into their products.
Comment 1 Dominic Lachowicz 2005-08-25 15:55:55 UTC
librsvg has never had a promise of API/ABI stability. In light of that, I've
marked those few functions as deprecated for the better part of 2 years. I've
informed Sven and others that they're deprecated. So now in a *unreleased
development version* of librsvg, I've removed the deprecated functions. As
librsvg is in the midst of a major overhaul in terms of its API and what it's
implemented in terms of (Cairo vs Libart), I don't think that's a problem. The
HEAD version wasn't meant to be used against the GNOME 2.x series anyway. Use
the GNOME-2-12 branch if you want the promised API/ABI stability, which I've
left in. As far as I'm concerned, bug 314400 is a bug in the Gimp.
Comment 2 Dominic Lachowicz 2005-08-25 16:22:17 UTC
I'm going to retreat somewhat from my previous comment. I believe that this is a
bug in Garnome's choice to package a CVS HEAD version of librsvg, which is
undergoing massive internal and external changes. The CVS HEAD version of
librsvg was not meant to be used with the GNOME 2.x series, and Paul made a
mistake by assuming that it would be. As such, I'm going to close this bug as
WONTFIX/INVALID. When mixing and matching unreleased, development versions of
libraries, caveat emptor.
Comment 3 Sven Neumann 2005-08-25 17:07:09 UTC
Hmm, I wouldn't mind if you reassigned the bug to gimp since otherwise someone
else will run into the problem and then has to open a new report for it. It
shouldn't be hard to workaround this issue in the gimp plug-in and if this
happens soon, the change could even go into gimp 2.2.9 still.

If on the other hand you are saying that noone should be using the CVS version
of librsvg, then I don't see any need for action.
Comment 4 Sven Neumann 2005-08-25 17:23:31 UTC
Created attachment 51331 [details] [review]
handle API change in GIMP plug-in

Would this patch work?

Btw, it would have saved me a lot of time if the librsvg ChangeLog would
mention releases and changes to the version numbers. Or if releases would at
least be tagged...
Comment 5 Joseph Sacco 2005-08-25 20:09:23 UTC
Created attachment 51338 [details] [review]
patch  gimp-2.3.3  to build using librsvg-2.9.9

I want to thank everyone involved for bringing this issue to closure.
 
librsvg-2.9.9, the 10Aug05 CVS version, may now be used to build
GARNOME-2.11.92.

-Joseph
Comment 6 Sven Neumann 2005-08-25 20:18:18 UTC
Reopening for GIMP.
Comment 7 Sven Neumann 2005-08-25 20:22:52 UTC
Joseph, in the patch you attached, why did you change the way the version number
is being handled? The current CVS version of librsvg has

 LIBRSVG_MAJOR_VERSION=2
 LIBRSVG_MINOR_VERSION=99
 LIBRSVG_MICRO_VERSION=0

Your patch isn't going to work with that version. What was the reason to change
the version check in the first place?
Comment 8 Joseph Sacco 2005-08-25 21:00:21 UTC
I looked at the source code for the version I have, 10Aug05. 

The minor version is not 99:

   #ifndef LIBRSVG_FEATURES_H
   #define LIBRSVG_FEATURES_H 1

   #define LIBRSVG_MAJOR_VERSION (2)
   #define LIBRSVG_MINOR_VERSION (9)
   #define LIBRSVG_MICRO_VERSION (9)
   #define LIBRSVG_VERSION ""

I took a look at the latest version, which is 2.11.0.

   #ifndef LIBRSVG_FEATURES_H
   #define LIBRSVG_FEATURES_H 1

   #define LIBRSVG_MAJOR_VERSION (2)
   #define LIBRSVG_MINOR_VERSION (11)
   #define LIBRSVG_MICRO_VERSION (0)
   #define LIBRSVG_VERSION ""

So the logic for the #if's needs to be tweaked.


-Joseph
Comment 9 Sven Neumann 2005-08-25 22:39:58 UTC
The question is, when was the API changed? What version should we check for if
we want to use the newer form of rsvg_handle_set_dpi()? When was the deprecated
variant removed?
Comment 10 Joseph Sacco 2005-08-26 00:53:23 UTC
Sven,

I don't have a good understanding of the numbering system used by the librsvg
team, so I would focus only on stable releases.

Looking at the source code...

The API changed after the 2.9.5 stable release. In the 2.9.5 release
rsvg_handle_set_dpi_x_y()  was present and was not a member of the set of
"DEPRECATED" functions. In the 2.11.0 [stable???] release,
rsvg_handle_set_dpi_x_y() has disappeared along with the other functions that
were tagged as "DEPRECATED".  In fact the word "DEPCRECATED" has disappeared
completely from the 2.11.0 source.

So... I would suggest changing the test to 

#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 11)
   rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution);
#else
   rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution);
#endif

Thoughts???


-Joseph
 
Comment 11 Sven Neumann 2005-08-26 09:28:04 UTC
I am actually hoping for a quick note from Dom, telling us what version number
to check for...
Comment 12 Dominic Lachowicz 2005-08-26 12:29:53 UTC
Sven, the second patch looks good to me. It will nicely handle the case of CVS
HEAD librsvg vs. the versions we mean to ship in the GNOME 2.12 release series
and below.
Comment 13 Joseph Sacco 2005-08-26 13:14:50 UTC
Looks like "we" are collectively driving this issue to closure. This is a good
thing. After all, the operative word in the open-source community is "we", not
"I" [:-)]


-Joseph
Comment 14 Sven Neumann 2005-08-26 17:21:38 UTC
Dom, sorry, perhaps I am just overlooking something here. But the second patch
checks for (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION == 9 &&
LIBRSVG_MICRO_VERSION < 9).

That isn't even going to work with the version that I have installed here
(2.8.1). Do you perhaps meant to say that the change proposed in comment #10
looks good?
Comment 15 Dominic Lachowicz 2005-08-26 17:30:35 UTC
Sorry, Sven. I didn't read the patch well enough. I just saw that it seemed to
handle both the old and new APIs. The approach in comment #10 looks good.
Comment 16 Sven Neumann 2005-08-26 19:54:08 UTC
OK, applied to both branches. This whole thing will cause packagers some
headaches but I don't see what we can do about that...

2005-08-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/svg.c: deal with SVG API change. This is a
	compile-time check and thus somewhat ugly because it requires a
	recompile of the plug-in when updating librsvg. Fixes bug #314400.
Comment 17 Sven Neumann 2005-09-19 19:36:38 UTC
*** Bug 316719 has been marked as a duplicate of this bug. ***
Comment 18 Sven Neumann 2005-09-20 16:39:05 UTC
Obviously (see bug #316719) the change was not correct, even though I
explicitely asked the librsvg maintainer to check that it is :(
Comment 19 Sven Neumann 2005-09-20 16:39:35 UTC
Reopening, arghh!
Comment 20 Sven Neumann 2005-09-20 16:53:23 UTC
After comparing various states in CVS, I have settled on the following version
and committed to both branches:

#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION < 99)
  rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution);
#else
  rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution);
#endif

It would have been a lot easier if librsvg CVS had tags for all releases and if
Joseph and Dom would have paid a little more attention. I hope that the issue is
solved now...

Comment 21 Joseph Sacco 2005-09-20 17:05:33 UTC
Huh???

-Joseph
Comment 22 Dominic Lachowicz 2005-09-20 18:00:19 UTC
Don't pass the buck, Sven. Review patches for your own product, and accept
responsibility for them when things fail. I said that something like what was
proposed would work ok ("The approach in comment #10 looks good."), and I said
that librsvg 2.12 would NOT break API/ABI.
Comment 23 weskaggs 2005-09-20 20:07:28 UTC
*** Bug 316799 has been marked as a duplicate of this bug. ***
Comment 24 Alf-Ivar Holm 2005-10-31 14:08:22 UTC
gimp 2.2.9 failed with librsvg 2.7.1 and 2.13.2, both exited with "undefined 
reference to `rsvg_handle_set_dpi_x_y'" in svg.c:441 and svg.c:542.  If I do a 
nm -s on the 2.13.2 archive of librsvg I find the rsvg_handle_set_dpi function 
but not the ..._x_y one.  LIBRSVG_MINOR_VERSION is defined as 7 and 13 
respectively.  I've had noe problems with earlier gimp versions (ie <= 2.2.8).
So, neither #10 nor #20 seems to work me, but #14 would.  (But then again, I 
never tried the 2.9.x version of librsvg.)
Comment 25 weskaggs 2005-10-31 15:22:02 UTC
*** Bug 320148 has been marked as a duplicate of this bug. ***
Comment 26 Michael Schumacher 2005-11-14 16:54:48 UTC
If I understood bug 320007 correctly, librsvg 2.13 is no stable release (taken
from CVS HEAD?) and still changing. So it wouldn't be surprising that building
against it fails.
Comment 27 Spam Less 2005-11-16 03:13:45 UTC
There is one problem with the above. The suggested code:
  rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution)
which appears in gimp 2.2.9 (svg.c) is wrong. The rsvg_handle_set_dpi function
only takes one dpi value, of course:
  rsvg_handle_set_dpi (handle, vals->resolution)

Gimp 2.2.9 has a problem with the test and even if the test worked, the second
branch (the set_dpi with two parameters) would not work. The wrong number of
parameters in the set_dpi function is another item to watch out for.
Comment 28 Dominic Lachowicz 2005-11-16 13:26:52 UTC
Listen, I changed librsvg's API back to 1-arg set_dpi() and set_default_dpi() a
while ago in order to placate everyone here and renamed the 2-arg versions to
include an "x_y" in their name, just like before. There was 1 unstable release
that had the 2-arg version of set_dpi(), and I wouldn't support that if I were
you. Please act accordingly.
Comment 29 Sven Neumann 2005-11-16 13:51:51 UTC
That is the information that I asked for two months ago. Oh well, is anyone
willing to clean up this mess? I feel bored by this issue but will look into
applying a patch if one is provided here.
Comment 30 Sven Neumann 2005-12-07 01:07:44 UTC
I would like to get this sorted out for the 2.2.10 and 2.3.6 releases.
Increasing priority accordingly.
Comment 31 Michael Schumacher 2005-12-07 10:17:33 UTC
Hm, when comparing comment 28 to comment 24 - why does this happen? According to
comment 28, rsvg_handle_set_dpi_x_y should exists as we use it (and current CVS
certainly works with all the 2.12.x I tried).

Dom, are 2.13.2 and 2.7.1 (see comment 24) unstable and/or buggy versions?
Comment 32 Michael Natterer 2005-12-07 10:44:38 UTC
If checking the actual version is so complicated, why don't
we just write

#ifdef svg_handle_set_dpi_x_y
 /* foo */
#else
 /* bar */
#endif

???
Comment 33 Joseph Sacco 2005-12-07 14:12:36 UTC
Why is this issue so hard to put to rest??? 

If the version numbering sheme used by librsvg is sequential in some
deterministic manner, the resolution should be simple.

-----------------------------------------------------------------------> TIME
  ... |               |                    |       ...           |
      Vn             Vn+1                  Vn+2                  Vp

#if (VERSION < Vk)
 rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution);
#else
  rsvg_handle_set_dpi (handle, vals->resolution);
#endif

The problem is reduced to how to specify the inequality.

The librsvg team has "surrendered" and has added support for both functions in
its current version.

-Joseph
Comment 34 Michael Schumacher 2005-12-12 12:21:23 UTC
So why would we have to change anything (except the check) if
rsvg_handle_set_dpi_x_y is supported with 2 parameters from now on?

Is rsvg_handle_set_dpi_x_y deprecated? I want a "yes" or "no" as an answer, and
whoever answers it will be held liable if it turns out to be incorrect :)
Comment 35 Mukund Sivaraman 2005-12-15 15:28:04 UTC
librsvg-2.11.0.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double
dpi_x, double dpi_y);
librsvg-2.11.1.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
librsvg-2.12.4.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
librsvg-2.12.5.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
librsvg-2.12.6.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
librsvg-2.12.7.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
librsvg-2.13.0.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double
dpi_x, double dpi_y);
librsvg-2.13.1.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double
dpi_x, double dpi_y);
librsvg-2.13.2.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double
dpi_x, double dpi_y);
librsvg-2.13.3.tar.bz2
rsvg.h:void        rsvg_handle_set_dpi           (RsvgHandle * handle, double dpi);
rsvg.h:void        rsvg_handle_set_dpi_x_y           (RsvgHandle * handle,
double dpi_x, double dpi_y);
Comment 36 Mukund Sivaraman 2005-12-16 11:05:43 UTC
Created attachment 56064 [details] [review]
Patch against 2.3.5 GIMP to work around for librsvg versions {2.11.0, 2.13.0, 2.13.1, 2.13.2}

Please check my last post for the version specific function declarations.

This's a source level fix. I am not sure if an ABI-compatible cross-version fix
is even possible.
Comment 37 Mukund Sivaraman 2005-12-18 22:41:38 UTC
The patch doesn't have \ line endings for the multi-line macro, so please add them when you apply it.
Comment 38 Sven Neumann 2005-12-19 12:33:14 UTC
Created attachment 56154 [details] [review]
patch that I am going to apply to both branches
Comment 39 Sven Neumann 2005-12-19 12:37:43 UTC
2005-12-19  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/svg.c: fixed handling of librsvg API change,
	based on a patch by S. Mukund (bug #314400).