From: Tony Cook Date: Tue, 24 Apr 2001 09:32:32 +0000 (+0000) Subject: added code to report errors from gif file reading/writing X-Git-Tag: Imager-0.48^2~719 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/3827fae079759315f3e65f20062c185b6e9cb5c0 added code to report errors from gif file reading/writing --- diff --git a/Imager.pm b/Imager.pm index cbbc0901..d7e1845b 100644 --- a/Imager.pm +++ b/Imager.pm @@ -495,7 +495,7 @@ sub read { if ( $input{type} eq 'gif' ) { if (exists $input{data}) { $self->{IMG}=i_readgif_scalar($input{data}); } else { $self->{IMG}=i_readgif( $fd ) } - if ( !defined($self->{IMG}) ) { $self->{ERRSTR}='unable to read gif image'; return undef; } + if ( !defined($self->{IMG}) ) { $self->{ERRSTR}= 'reading GIF:'._error_as_msg(); return undef; } $self->{DEBUG} && print "loading a gif file\n"; } elsif ( $input{type} eq 'jpeg' ) { if (exists $input{data}) { ($self->{IMG},$self->{IPTCRAW})=i_readjpeg_scalar($input{data}); } @@ -617,7 +617,7 @@ sub write { $rc=i_writegifmc($self->{IMG},$fd,$input{gifplanes}); } if ( !defined($rc) ) { - $self->{ERRSTR}='unable to write gif image'; return undef; + $self->{ERRSTR} = "Writing GIF file: "._error_as_msg(); return undef; } $self->{DEBUG} && print "writing a gif file\n";