codec: gif format (best effort comparison)
[sheet.git] / codec.plp
index 2cc454ad3f20bd3c830b4c14eceeec84ced0f1fc..35b97ed30d5bb29b0b0cf3aa0b68197682238f37 100644 (file)
--- a/codec.plp
+++ b/codec.plp
@@ -1,5 +1,7 @@
 <(common.inc.plp)><:
 
+my @feat = split m{/+}, $Request || 'default';
+
 Html({
        title => 'Codecs',
        version => '1.0',
@@ -20,7 +22,7 @@ my %BOOLSCORE = (y => 5, n => 1);
 
 <div class="section">
 <table class="mapped">
-       <col><colgroup span=2><colgroup span=2><colgroup span=3>
+       <col><colgroup span=3><colgroup span=2><colgroup span=3>
 <thead><tr><th rowspan=2>feature
 <:
 my @codecs = sort {
@@ -32,9 +34,11 @@ print "\n<tr>";
 print '<td>', $_->{available} for @{$info->{codec}}{@codecs};
 say '</thead>';
 
-print '<tbody>';
-for my $feat (sort keys %{$info->{feature}}) {
-       my $featinfo = $info->{feature}->{$feat};
+while (defined (my $feat = shift @feat)) {
+       my $featinfo = $info->{feature}->{$feat} or next;
+       unshift @feat, @{$_} for $featinfo->{children} // ();
+       $featinfo->{score} or $featinfo->{data} or next;
+       print '<tbody>' if $featinfo->{children};
        printf '<tr><th>%s', $featinfo->{name} // $feat;
        printf('<td class="l%d">%s',
                (map { $_ && $BOOLSCORE{$_} || $_ || 0 } $featinfo->{score}->{$_}),