вторник, 3 августа 2010 г.

First results of test - bmp

Old bmpEndAnalyzer:

./test.bmp
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".

Generated bmpEndAnalyzer by Translator:

./test.bmp
http://freedesktop.org/standards/xesam/1.0/core#formatSubtype
"Windows Bitmap";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#contentSize
"921654";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#isPartOf
"";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#lastModified
"1280740186";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#mimeType
"image/bmp",
"image/bmp";
http://www.semanticdesktop.org/ontologies/2007/01/19/nie#url
"./test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth
"24";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName
"test.bmp";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height
"480";
http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width
"640";
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage",
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject".


TFL input file:

Format Bmp;
Metadata: BmpInfoHeader;

if(BmpInfoHeader)
{
Type = "http://freedesktop.org/standards/xesam/1.0/core#formatSubtype";
Compression = "http://freedesktop.org/standards/xesam/1.0/core#compressionAlgorithm";
Width = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#width";
Height = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#height";
Color = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#colorDepth";

&rdftype = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
&rasterImage = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage";

D: rdftype - rasterImage;

}


TL input file:

Binary BmpInfoHeader;

StartMetadataKey BM(offset=0, size=2);
checkKey(BM)="BM";

if(getString(BM)=="BM") SetTag Type("Windows Bitmap");

MetadataKey Width(start, offset=18, size=4);
SetTag Width(getNumber(Width));

MetadataKey Height(Width, offset=0, size=4);
SetTag Height(getNumber(Height));

MetadataKey BitCount(Height, offset=2, size=2);
SetTag Color(getNumber(BitCount));

MetadataKey Compression(BitCount, offset=0, size=4);
if(getNumber(Compression)==0) setTag Campression("None");
if(getNumber(Compression)==1) setTag Campression("RLE 8bit/pixel");
if(getNumber(Compression)==2) setTag Campression("RLE 4bit/pixel");
if(getNumber(Compression)==3) setTag Campression("Bit fields");

Комментариев нет:

Отправить комментарий