Subject: | Segfault |
Date: | Thu, 10 Jan 2019 04:45:10 +0000 |
To: | "bug-Imager [...] rt.cpan.org" <bug-Imager [...] rt.cpan.org> |
From: | Ritchey Mulhollem <ritchey.mulhollem [...] protonmail.com> |
Getting a segfault when making a circle.
[wolf@Wolflake] cgi-bin $sudo perl test.pl
Segmentation fault
[wolf@Wolflake] cgi-bin $
use strict;
use warnings;
use LWP::Simple;
use Imager;
for(1..3){
getstore("https://cdn.star.nesdis.noaa.gov/GOES16/ABI/SECTOR/sp/0$_/2400x2400.jpg", "band-$_.jpg")
}
my $B = Imager->new;# Band 1 .47um (blue)
$B->read(file=>"band-1.jpg") or die $B->errstr;
my $R = Imager->new;# Band 2 .64um (red)
$R->read(file=>"band-2.jpg") or die $R->errstr;
my $G = Imager->new;# Band 3 .86um (Near IR [Veggie])
$G->read(file=>"band-3.jpg") or die $G->errstr;
$G->filter(type=>"contrast", intensity=>.9);
#No saturation? Seriously? $G->filter(type=>"saturation", intensity=>-0.5);
# make an RGB image from Red, IR, and Blue images
my $RGB = Imager->combine(src => [ $R, $G, $B ]);# Order is [RED, GREEN, BLUE] for ploting polyline below--> $RGB->write(file=>"RGB.jpg");exit;
my $origin=[1380,820];# upper left
#my @center=[1470, 840];
my @center=[470, 440];
my $color=Imager::Color->new(255,0,0);
$RGB->circle (aa=>1, color=>$color, r=>100, x=>$center[0], y=>$center[1], filled=>1);
$RGB->polyline(aa=>1, color=>$color, points=> [ $origin, [2050,790], [1950,1200], [1260,1210], $origin ]); # same as in IrfanView when a point is click-held. top/left, top/right, bot/right, bot/left, back to top/left
my $OUT = $RGB->crop(left=>190, top=>164, width=>2210, height=>2009); # same as in IrfanView crop information when set to 100% zoom
$OUT->write(file=>time."_GEOS-16_Color.jpg") or die $OUT->errstr;