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 320148 - svg.c plugin : Gimp 2.2.9 : bad version check and code.
svg.c plugin : Gimp 2.2.9 : bad version check and code.
Status: RESOLVED DUPLICATE of bug 314400
Product: GIMP
Classification: Other
Component: Plugins
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-29 06:33 UTC by Spam Less
Modified: 2008-01-15 13:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Spam Less 2005-10-29 06:33:55 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.
Comment 1 Spam Less 2005-10-30 16:01:40 UTC
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.)
Comment 2 weskaggs 2005-10-31 15:22:00 UTC
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 ***
Comment 3 Spam Less 2005-11-16 03:08:07 UTC
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.