Net-Flickr-Geo
view release on metacpan or search on metacpan
lib/Net/Flickr/Geo.pm view on Meta::CPAN
$out ||= $self->mk_tempfile(".png");
my $pinwin = $self->load_pinwin();
#
my $truecolour = 1;
use GD;
my $pw = GD::Image->newFromPng($pinwin, $truecolour);
$pw->alphaBlending(0);
$pw->saveAlpha(1);
my $th = GD::Image->newFromJpeg($thumb_data->{'path'});
$th->alphaBlending(0);
$th->saveAlpha(1);
# place the thumb on the pinwin
$pw->copy($th, 11, 10, 0, 0, 75, 75);
lib/Net/Flickr/Geo.pm view on Meta::CPAN
}
return $out;
#
# we now return you to your regular programming which doesn't work...
#
# place the pinwin on the map
my $map = GD::Image->newFromPng($map_data->{'path'}, $truecolour);
$map->alphaBlending(0);
$map->saveAlpha(1);
# fix me!
# why doesn't the alpha in $pw get preserved
$map->copy($pw, $x, $y, 0, 0, 159, 146);
#
lib/Net/Flickr/Geo/ModestMaps.pm view on Meta::CPAN
my $map_img = shift;
my $markers = shift;
# use GD instead of Imager because the latter has
# a habit of rendeing the actual thumbnails all wrong...
# ensure the truecolor luv to prevent nasty dithering
my $truecolor = 1;
my $im = GD::Image->newFromPng($map_img, $truecolor);
foreach my $data (@$markers){
my ($mrk_img, $x, $y, $w, $h) = @$data;
my $ph = GD::Image->newFromJpeg($mrk_img, $truecolor);
eval {
$im->copy($ph, $x, $y, 0, 0, $w, $h);
};
if ($@){
( run in 0.658 second using v1.01-cache-2.11-cpan-0a6323c29d9 )