in reply to Re: Imager: Gateway Timeout
in thread Imager: Gateway Timeout

Alas, the module you mention is for GIF's. I'm working on JPG. But thanks anyway

Replies are listed 'Best First'.
Re^3: Imager: Gateway Timeout
by Anonymous Monk on Dec 24, 2019 at 21:25 UTC
    Alas, the module you mention is for GIF's. I'm working on JPG.

    Image::ParseGIF would be used to present the progress bar, which is a "deanimated" GIF, not for parsing your original image. Click the given link, then click "browse", then click "examples" for a free progress bar GIF and some example scripts. It would go something like this:

    for (my $p=0; $p<@pics; $p++){ $img=Imager->new(); # create empty image my $gif = Image::ParseGIF->("progress.gif") or die "failed to parse: $@\n"; $gif->print_header; $gif->print_percent(0.00); $img->read(file=>$baseURL.$type.'/'.$pics[$p],type=>'jpeg') or die $img->errstr(); my $med = $img->copy(); my $thumb = $img->copy(); $med = $img->scale(xpixels=>750);# sets width to 750px $med->write(file=>$baseURL.$type.'/medium/'.$pics[$p]) or die $image->errstr; # Write out image $gif->print_percent(0.10); # 10% complete $thumb = $img->scale(ypixels=>150);# sets the height to 150px $thumb->write(file=>$baseURL.$type.'/thumbs/'.$pics[$p]) or die $image->errstr; # Write out image $gif->print_percent(0.25); # 25% complete my $rot90 = $img->rotate(degrees=>-90); $rot90->write(file=>$baseURL.$type.'/upright/'.$pics[$p]) or die $image->errstr; # Write out image $gif->print_percent(0.70); # 70% complete my @pic=split(/\./,$pics[$p]); # splits filename at dot [filename][j +pg] $newDat.=$pic[0].'|'; # Used in a latter part of program $gif->print_percent(1.00); # done! $gif->print_trailer; }
  • https://metacpan.org/source/BENL/Image-ParseGIF-0.2/examples
  • https://fastapi.metacpan.org/source/BENL/Image-ParseGIF-0.2/examples/progressbar.gif