No subject

Sun May 13 13:41:23 UTC 2007

## if we use z-lib let's give it a try
if( Image::LibRSVG->isGzCompressionSupported() ) {
    ok( $rsvg->loadImage( "examples/artscontrol.svg.gz" ) );
    ok( $rsvg->saveAs( "examples/test.png" ) );
} else {

...I reproduced it - the problem is that $rsvg->loadImage with a
svg.gz triggers a segfault, and all the tests from that point on don't
get executed at all. Just to illustrate, from the source tree, just
after the build died (hence with the compiled module in blib/):

$ perl -Iblib/lib -Iblib/arch -e 'use Image::LibRSVG; $rsvg=Image::LibRSVG->new; print $rsvg->loadImage("examples/artscontrol.svg.gz")'

triggers basically the same message as the one reported in the
bug. Now, the faulty function seems to be
Image::LibRSVG->isGzCompressionSupported - In fact, it is not even
documented, and the build does not depend on (nor ever mention)
Perl's Compress::Zlib or C's zlib. This function is not even
documented in the POD or used anywhere else in the code:

$ grep -r isGzCompr .|grep -v svn
./t/1.t:if( Image::LibRSVG->isGzCompressionSupported() ) {
./Changes:       - added new function "isGzCompressionSupported" to check if gzipped files can be passed

And anyway, in the XS, line 454, it is hardcoded to answer "yes":

static bool
            RETVAL = 1;

In fact, changing the 1 to a 0 makes the build work. So, the diff is a

Index: LibRSVG.xs
--- LibRSVG.xs	(revision 5662)
+++ LibRSVG.xs	(working copy)
@@ -455,7 +455,7 @@
 static bool
-            RETVAL = 1;
+            RETVAL = 0;

I'm not uploading this, as I'm unfamiliar with the code and I might be
just breaking it. Please, if you use this package, test it and tell
me if it should be uploaded (or upload yourself if you prefer, of
course ;-) ) 


Gunnar Wolf - gwolf at - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF

More information about the pkg-perl-maintainers mailing list