GNOME Bugzilla – Bug 320148
svg.c plugin : Gimp 2.2.9 : bad version check and code.
Last modified: 2008-01-15 13:01:51 UTC
Distribution/Version: Fedora Core 2 (updated) Gimp 2.2.9 - using the patch to update the 2.2.8 tarball. In plug-ins/common/svg.c: #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 (in 2.2.8 it was just rsvg_handle_set_dpi (handle, vals->resolution); ONLY TWO PARAMETERS! THE SECOND CASE IN THE ELSE IS WRONG.) Not working. Fedora Core 2; rpms for librsvg2-2.6.4-2 /usr/include/librsvg-2/librsvg/librsvg-features.h indicates: #ifndef LIBRSVG_FEATURES_H #define LIBRSVG_FEATURES_H 1 #define LIBRSVG_MAJOR_VERSION (2) #define LIBRSVG_MINOR_VERSION (6) #define LIBRSVG_MICRO_VERSION (4) #define LIBRSVG_VERSION "" extern const unsigned int librsvg_major_version, librsvg_minor_version, librsvg_micro_version; extern const char *librsvg_version; void librsvg_preinit(void *app, void *modinfo); void librsvg_postinit(void *app, void *modinfo); #endif and I get the error: undefined reference to rsvg_handle_set_dpi_x_y when comiling gimp 2.2.9 (in the svg.c compilation). I assume the test on LIBRSVG_MINOR_VERSION should have been different. Let me grep the string "LIBRSVG_MAJ". It appears this test is only made in svg.c. Let me change the second test (it appears twice) to "LIBRSVG_MINOR_VERSION > 10" (I just chose "10" since is larger than the value of my version and I have been running gimp 2.2.8 - or perhaps I should have used "< 3"? No matter ...). That did not work until I also changed the second clause to the proper: rsvg_handle_set_dpi (handle, vals->resolution); (I got an error about the wrong number of variables) (in the two places it occurs). Finally I got past the svg.c compilation. It appears that the test is wrong and even if it were right, the second clause is wrong.
Apparently the correct test is either LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION > 10 or LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION = 11 && LIBRSVG_MICRO_VERSION == 0 --- The Changelog for gimp.2.2.9 shows: * 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 to 2.11.0 or newer. so the new (dpi_x_y) should only apply to later versions. But the librsvg site shows: librsvg 2.11.1 released August 29, 2005: On the heels of our previous release here is another releaseof librsvg from the 2.11.x branch. This release fixes some API breakage introduced in librsvg 2.11.0 ... (Did they go back to just "dpi" in 11.1 or did they include both and what will be supported in later versions? Hopefully there will not be further changes in the APIs.)
Thanks, this problem has already been reported, and we are trying to figure out how to handle it (see also bug 320007). *** This bug has been marked as a duplicate of 314400 ***
Almost. Checking bug 314400 I see that a suggestion is made to use _dpi with two parameters (it only takes one). Besides a problem with what versions only support _dpi_x_y, the code for the _dpi function is wrong.