rmagic fails on call to GD
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rmagic (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: rmagic
Using Ubuntu 8.10,
Although the error message comes from libgd, it's due to the code in the Settings.pm file referred to below. The problem is that this perl script tries to create a 0x0 image, which apparently worked with earlier versions of libgd.
I expected rmagic (called from a complex PERL script) to generate a report from the output of analog. Instead, no report, and the error message:
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/
Here is a fix that worked for me, Settings-orig.pm is the version of Settings.pm which came with the package.
--- Settings-orig.pm 2009-01-09 08:42:44.000000000 +0900
+++ Settings.pm 2009-01-09 08:43:07.000000000 +0900
@@ -907,7 +907,7 @@
# Check GD for support of desired output format. If none
# given or not capable, then set output format accordingly.
#
- my $g = new GD::Image(0,0);
+ my $g = new GD::Image(1,1);
if( defined $self->val( 'graphs', 'Format' ) ) {
if( $self->val( 'graphs', 'Format' ) =~ /jpe?g/i ) {
Changed in rmagic (Ubuntu): | |
status: | Confirmed → Fix Committed |
I just tried Mark's suggested fix. Worked perfectly for me.