#!/usr/bin/perl -w use strict; my $bmp = "pic.bmp"; my $html = "pic.html"; my $temp; open (IN, "<$bmp") || die; while() { $temp .= $_; } close IN; my $col = (ord(substr $temp,18,1)) + (256*(ord(substr $temp,19,1))); my $row = (ord(substr $temp,22,1)) + (256*(ord(substr $temp,23,1))); my $numread = $col * 3; while ( ($numread % 4) != 0 ) { $numread++; } open (OUT, ">$html") || die; print OUT ""; for (my $i = ($row-1); $i >= 0; $i--) { print OUT ""; for my $j (0..($col-1)) { print OUT ""; } print OUT ""; } print OUT "
"; close OUT;