]> git.imager.perl.org - imager.git/commitdiff
added code to report errors from gif file reading/writing
authorTony Cook <tony@develop=help.com>
Tue, 24 Apr 2001 09:32:32 +0000 (09:32 +0000)
committerTony Cook <tony@develop=help.com>
Tue, 24 Apr 2001 09:32:32 +0000 (09:32 +0000)
Imager.pm

index cbbc090104cee0e5c9629576d5ec9992d8bf65d9..d7e1845bb78e87dc19324167d6d4a49fa330f9d9 100644 (file)
--- 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";