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 612560 - Size and width of a sub-element of an SVG are wrong for KDE card decks
Size and width of a sub-element of an SVG are wrong for KDE card decks
Status: RESOLVED DUPLICATE of bug 564527
Product: librsvg
Classification: Core
Component: general
2.26.x
Other Linux
: Normal minor
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-11 12:33 UTC by Markus Schwab
Modified: 2010-03-11 14:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
KDE card decks (796.31 KB, image/svg+xml-compressed)
2010-03-11 12:33 UTC, Markus Schwab
Details

Description Markus Schwab 2010-03-11 12:33:13 UTC
Created attachment 155851 [details]
KDE card decks

Calling the rsvg-dimensions test application from librsvg-2.26.0 on the (unzipped oxygen.svgz) KDE card-images gives the following (beautified) output:

$ ./rsvg-dimensions /tmp/cards.svg
/tmp/cards.svg: 2105x1488, em=2105.000000, ex=1488.000000
$ ./rsvg-dimensions /tmp/cards.svg -f \#4_club
/tmp/cards.svg, fragment `#4_club': x=497, y=35, 12981x18336, em=12981.000000, ex=18336.000000

The whole SVG has a size of 2105x1488, but the sub-image claims to be of size 12981x18336; i.e. ways bigger than the actual image (try and error makes me believe that its size is around 160x200).

Not surprisingly rsvg_handle_get_pixbuf_sub() also gives a wrong image, the 4 of club is squeezed into the upper-right corner.

Changing the calls to use GNOME's card-images works fine (i.e. it's not rsvg-dimensions being the problem).

I tried to debug a bit into that and added some output to rsvg-base.c to show the values involved in the size-calculation (by adding the following lines at line 1391):

printf ("X-Factor: %c -> %f %f %f\n", root->w.factor, bbox.w, 
        handle->priv->dpi_x, bbox.w + bbox.x * 2);
printf ("Y-Factor: %c -> %f %f %f\n", root->h.factor, bbox.h,
        handle->priv->dpi_y, bbox.h + bbox.y * 2);

This gives the following output:

X-Factor: i -> 144.230469 90.000000 1137.738281
Y-Factor: i -> 203.734375 90.000000 272.914062

I'm quite at loss here and can't even say if this is a problem with librsvg, cairo or the KDE card-images (I don't have KDE installed, only the images).

I attached the (original, compressed) KDE card-deck.
Comment 1 Christian Persch 2010-03-11 13:49:50 UTC
Dup of bug 564527 ?
Comment 2 Markus Schwab 2010-03-11 14:06:55 UTC
Sounds like it (even with the same test-file, only asking for another sub-image i.e. card). Sorry, I *was* checking the bug-database, but it seems not thoroughly enough.

Any idea when this fix will be out?

*** This bug has been marked as a duplicate of bug 564527 ***