2 # Takes image filename, outputs file contents in format for css background
3 # (Public Domain) / Ant P. / 2007-02-01
9 print &file_to_data
($_)."\n\n" if ( -r
);
14 (my $type = `file -bi $file`) =~ s/\s//g;
15 my $dat = URI
->new('data:');
17 print "========== $file\n";
18 if ( $type eq 'image/png' ) {
19 print `optipng -i0 $file`;
21 print "Not preprocessing filetype $type\n";
24 $dat->media_type($type);
25 $dat->data(scalar(`cat $file`));