HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/x86_64-linux-gnu/perl5/5.24/Imager/File/GIF.pm
package Imager::File::GIF;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
  $VERSION = "0.91";

  require XSLoader;
  XSLoader::load('Imager::File::GIF', $VERSION);
}

Imager->register_reader
  (
   type=>'gif',
   single => 
   sub { 
     my ($im, $io, %hsh) = @_;

     if ($hsh{gif_consolidate}) {
       if ($hsh{colors}) {
	 my $colors;
	 ($im->{IMG}, $colors) =i_readgif_wiol( $io );
	 if ($colors) {
	   ${ $hsh{colors} } = [ map { NC(@$_) } @$colors ];
	 }
       }
       else {
	 $im->{IMG} =i_readgif_wiol( $io );
       }
     }
     else {
       my $page = $hsh{page};
       defined $page or $page = 0;
       $im->{IMG} = i_readgif_single_wiol($io, $page);

       unless ($im->{IMG}) {
	 $im->_set_error(Imager->_error_as_msg);
	 return;
       }
       if ($hsh{colors}) {
	 ${ $hsh{colors} } = [ $im->getcolors ];
       }
       return $im;
     }
   },
   multiple =>
   sub {
     my ($io, %hsh) = @_;

     my @imgs = i_readgif_multi_wiol($io);
     unless (@imgs) {
       Imager->_set_error(Imager->_error_as_msg);
       return;
     }

     return map bless({ IMG => $_, ERRSTR => undef }, "Imager"), @imgs;
   },
  );

Imager->register_writer
  (
   type=>'gif',
   single => 
   sub { 
     my ($im, $io, %hsh) = @_;

     $im->_set_opts(\%hsh, "i_", $im);
     $im->_set_opts(\%hsh, "gif_", $im);

     unless (i_writegif_wiol($io, \%hsh, $im->{IMG})) {
       $im->_set_error(Imager->_error_as_msg);
       return;
     }
     return $im;
   },
   multiple =>
   sub {
     my ($class, $io, $opts, @ims) = @_;

     Imager->_set_opts($opts, "gif_", @ims);

     my @work = map $_->{IMG}, @ims;
     unless (i_writegif_wiol($io, $opts, @work)) {
       Imager->_set_error(Imager->_error_as_msg);
       return;
     }

     return 1;
   },
  );

__END__

=head1 NAME

Imager::File::GIF - read and write GIF files

=head1 SYNOPSIS

  use Imager;

  my $img = Imager->new;
  $img->read(file=>"foo.gif")
    or die $img->errstr;

  $img->write(file => "foo.gif")
    or die $img->errstr;

=head1 DESCRIPTION

Imager's GIF support is documented in L<Imager::Files>.

=head1 AUTHOR

Tony Cook <tonyc@cpan.org>

=head1 SEE ALSO

Imager, Imager::Files.

=cut