Skip Menu |

This queue is for tickets about the Image-Xpm CPAN distribution.

Report information
The Basics
Id: 7438
Status: resolved
Priority: 0/
Queue: Image-Xpm

People
Owner: SREZIC [...] cpan.org
Requestors: ashand [...] wetafx.co.nz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Patches for Image::Xpm build
When trying to install Image::Info we had problems with it failing the Image::Xpm and Image::Xbm tests. The maintainer tightened up some of the constructor code to test for the existence of the source file, but forgot that the source might actually be a reference to a file handle and this fails the test saying the file is not readable. These two patches should go back to the maintainer of the Image::X[pb]m perl modules that would be good. NOTE: Your email address listed in CPAN is currently bouncing (summer at perl press dot com).
diff -urw Image-Xpm-1.09/Xpm.pm Image-Xpm-1.09.patched/Xpm.pm --- Image-Xpm-1.09/Xpm.pm 2000-11-10 08:05:56.000000000 +1300 +++ Image-Xpm-1.09.patched/Xpm.pm 2004-08-22 17:15:20.000000000 +1200 @@ -167,8 +167,9 @@ $self->{-cc} = ' ' x $self->{-cpp}; my $file = $self->get('-file'); - $self->load if defined $file and -r $file and not $self->{-pixels}; - + if (defined $file and not $self->{-pixels}) { + $self->load if ref $file or -r $file; + } croak "new() `$file' not found or unreadable" if defined $file and not defined $self->get('-width');
Hello, Image::Xpm->new(-file => $filehandle) doesnot work because `-r $file' test prvents load() function to be called. However, load() function works fine with filehandles. The attached patch is a quick fix for this problem. Actually I noticed this problem because of Image::Info 1.16 test failures on xpm files. With this patch, those tests are happy, too. -- Alexey Tourbin ALT Linux Team
--- Image-Xpm-1.09/Xpm.pm- 2000-11-09 19:05:56 +0000 +++ Image-Xpm-1.09/Xpm.pm 2004-12-16 04:43:19 +0000 @@ -167,7 +167,7 @@ sub new { # Class and object method $self->{-cc} = ' ' x $self->{-cpp}; my $file = $self->get('-file'); - $self->load if defined $file and -r $file and not $self->{-pixels}; + $self->load if defined $file and not $self->{-pixels}; croak "new() `$file' not found or unreadable" if defined $file and not defined $self->get('-width');
Resolved in 1.09_50.