15 my $ok = read $stream, $c, 1;
16 if(not defined $ok) { die "read error $!\n"; }
17 if(!$ok or $c eq $stopchar) { return $out; }
22 $scheme = readupto \
*STDIN
, ':';
23 $scheme eq 'data' or die "stdin is not a data url\n";
25 $meta = readupto \
*STDIN
, ',';
26 if($meta =~ /([^;]+);(.*)/)
28 ($mime, $encoding) = ($1, $2);
36 warn "MIME type is '$mime'\n";
38 $decoder = new MIME
::Decoder
$encoding or die "unsupported encoding '$encoding'\n";
39 $decoder->decode(\
*STDIN
, \
*STDOUT
) or die "decode error\n";
48 dataurl2bin - Decode "data:..." URLs from input stream and output the raw binary data