use utf8;
+{
intro => 'Comparison of audio compression formats.',
+keywords => [qw( audio sound codec encoder encoding decode compression file format type mime )],
codec => {
mp3 => {
name => '<abbr title="MPEG-1 Audio Layer III">MP3</abbr>',
use utf8;
+{
intro => 'Comparison of image encoding formats, based on <a href="https://cloudinary.com/blog/one_pixel_is_worth_three_thousand_words">Cloudinary</a> research.',
+keywords => [qw( image picture codec encoder encoding decode compression file format type mime )],
codec => {
jpeg => {
name => '<abbr title="Joint Photographic Experts Group">JPEG</abbr>',
$page !~ /\W/ or Html(), Abort('Invalid codec type request', 400);
@feat or @feat = 'default';
my $title = "$page codecs";
+my $info = eval { Data("codec-$page") };
+if ($@) {
+ $info = {};
+}
Html({
title => "$title cheat sheet",
version => '1.0',
- description => [
- ],
- keywords => [qw'
- codec encoder encoding decode file format type mime
- feature comparison support benchmark compression
- image audio video
- '],
+ description => $info->{intro},
+ keywords => [@{ $info->{keywords} // [] }, qw' feature comparison support benchmark '],
stylesheet => [qw'light circus dark red'],
data => ["codec-$page.inc.pl"],
raw => '<style>td,th {width:8%} tbody th {white-space:nowrap}</style>',
});
-my $info = Data("codec-$page");
-$info and %{$info} > 1
- or Abort("Requested codec type <q>$page</q> not available", '404 request not found', $@ // $!);
+%{$info}
+ or Abort("Requested codec type <q>$page</q> not available", '404 request not found');
say "<h1>\u$title</h1>";
say "<p>$_</p>" for $info->{intro} // ();