in reply to Re: Downloading KeyForge image
in thread Downloading KeyForge image
I have the error 'couldn't recognize image data at ...../perl/vendor/lib/Tk/Image.pm line 21'. Why is that?use 5.010; use strict; use warnings; use LWP::UserAgent; use Tk; use Tk::PNG; my $url = "https://cdn.keyforgegame.com/media/card_front/en/341_1_7C85 +4VPW72RH_en.png"; my $ua = LWP::UserAgent->new(agent => ''); my $response = $ua->get($url); die $response->status_line if not $response->is_success; my $data = $response->decoded_content(charset => 'none'); my $mw = MainWindow->new; $mw->Photo(-data => $data, -format => 'PNG');
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Downloading KeyForge image
by poj (Abbot) on May 21, 2019 at 20:43 UTC | |
by Stamm (Sexton) on May 21, 2019 at 21:07 UTC | |
by poj (Abbot) on May 21, 2019 at 21:15 UTC | |
Re^3: Downloading KeyForge image
by afoken (Chancellor) on May 21, 2019 at 20:00 UTC |