From ed88b0922b12b22b0f39e679ee9e4edb3567ff66 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Thu, 10 May 2001 07:56:47 +0000 Subject: [PATCH] make write_multi a bit simpler to use --- Imager.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Imager.pm b/Imager.pm index b9614f57..4047b716 100644 --- a/Imager.pm +++ b/Imager.pm @@ -706,6 +706,12 @@ sub write_multi { my ($class, $opts, @images) = @_; if ($opts->{type} eq 'gif') { + my $gif_delays = $opts->{gif_delays}; + local $opts->{gif_delays} = $gif_delays; + unless (ref $opts->{gif_delays}) { + # assume the caller wants the same delay for each frame + $opts->{gif_delays} = [ ($gif_delays) x @images ]; + } # translate to ImgRaw if (grep !UNIVERSAL::isa($_, 'Imager') || !$_->{IMG}, @images) { $ERRSTR = "Usage: Imager->write_multi({ options }, @images)"; @@ -1788,6 +1794,9 @@ The images are written interlaced if this is non-zero. A reference to an array containing the delays between images, in 1/100 seconds. +If you want the same delay for every frame you can simply set this to +the delay in 1/100 seconds. + =item gif_user_input A reference to an array contains user input flags. If the given flag -- 2.39.5