b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

读取Exif信息需要对JPEG和Exif格式有简单的了解(2)

电脑杂谈  发布时间:2019-07-16 09:09:55  来源:网络整理

FStream.Read( w, sizeof(w) );

w := ntohs(w);

while JPEG_APP1 <> w do

begin

FStream.Read( w, sizeof(w) );

FStream.Seek( ntohs(w)-sizeof(w), soFromCurrent );

FStream.Read( w, sizeof(w) );

w := ntohs(w);

if JPEG_END = w then

begin

result := result + ‘No Exif info.’ + CLRF;

FreeAndNil( FStream );

Exit;

end;

end;

result := result + ‘Segment APP1 found.’ + CLRF;

FStream.Read( w, sizeof(w) );

w := ntohs(w);

result := result + ‘Segment APP1 length: ‘ + format(‘%.4x’,[w]) + CLRF;

//search Exif sign —’Exif’

FStream.Read( dw, sizeof(dw) );

dw := ntohl( dw );

if JPEG_EXIF <> dw then

begin

in your life, there will at least one time that you forget yourself for someone, asking for no result, no company, no ownership nor love. just sk for meeting you in my most beautiful years.。in your life, there will at least one time that you forget yourself for someone, asking for no result, no company, no ownership nor love. just ask for meeting you in my most beautiful years. 。in your life, there will at least one time that you forget yourselffor someone, asking for no result, no company, no ownership norlove. just ask for meeting you in my most beautiful years.。

FreeAndNil( FStream );

Exit;

end;

result := result + ‘Exif sign found…’ + CLRF;

FStream.Read( w, sizeof(w) ); //two zero

//TIFF Header

TiffHeaderPos := FStream.Position;

FStream.Read( w, sizeof(w) );

if BYTE_ODR_I = w then

begin

result := result + ‘TIFF Header byte order is Intel.’ +CLRF;

end else

begin //如果是Motolora格式的就不处理了~~~~~~`

result := result + ‘TIFF Header byte order is Motolora.’ +CLRF;

FreeAndNil( FStream );

Exit;

zip格式分析_pmp格式分析_exif 格式分析

end;

eps文件格式又被称为带有预视图象的ps格式,它是由一个postscript语言的文本文件和一个(可选)低分辨率的由pict或tiff格式描述的eps文件是目前桌面印刷系统普遍使用的通用交换格式当中的一种综合格式。在计算机的任何数字文件都能自然手写签名,支持 pdf、word、excel、图片(jpeg / png / tiff)等格式,此外,手机专属app还能轻松将纸本文件数字化,直接将图档转成 pdf 格式。由于tiff格式支持多页,多页文件能够存在一个tiff文件中而不是让每个扫描页存在一系列的文件中。

FStream.Read( dw, sizeof(dw) );//第一个IFD的起始位置,其偏移量的计算起点是TIFF Header的起点

FStream.Seek( dw-8, soFromCurrent );//8==size of Image File Header

FStream.Read( w, sizeof(w) );//IFD.0 Entry Count

result := result + ‘TIFF IFD0 Entry count: ‘ + format(‘%.4x’,[w]) +CLRF;

IFD_0_EntryCount := w;

SetLength( FEntrys, IFD_0_EntryCount );

//read ifd entry

for i:=0 to IFD_0_EntryCount-1 do

begin

FStream.Read( FEntrys[i].u16tag, sizeof(u16) );

FStream.Read( FEntrys[i].u16type, sizeof(u16) );

FStream.Read( FEntrys[i].u32count, sizeof(u32) );

FStream.Read( FEntrys[i].u32value, sizeof(u32) );

GetEntrySize( FEntrys[i] );

end;

//read ifd value

for i:=0 to IFD_0_EntryCount-1 do

begin

GetEntryDescript( FEntrys[i], FTagInfo );

GetEntryData( FEntrys[i], TiffHeaderPos );

end;

//Offset of Exif IFD = The last TIFF IFDEntry value + TIFF header offset

FStream.Position := TiffHeaderPos + FEntrys[IFD_0_EntryCount-1].u32value;

FStream.Read( w, sizeof(w) );//IFD.1 Entry Count

result := result + ‘TIFF IFD1 Entry count: ‘ + format(‘%.4x’,[w]) +CLRF;

IFD_1_EntryCount := w;

SetLength( FEntrys, IFD_0_EntryCount + IFD_1_EntryCount );

for i:=IFD_0_EntryCount to Length(FEntrys)-1 do

begin

FStream.Read( FEntrys[i].u16tag, sizeof(u16) );

FStream.Read( FEntrys[i].u16type, sizeof(u16) );

FStream.Read( FEntrys[i].u32count, sizeof(u32) );

FStream.Read( FEntrys[i].u32value, sizeof(u32) );

GetEntrySize( FEntrys[i] );

end;

for i:=IFD_0_EntryCount to Length(FEntrys)-1 do

begin

GetEntryDescript( FEntrys[i], FTagInfo );

GetEntryData( FEntrys[i], TiffHeaderPos );

end;

FInfCount := Length(FEntrys);

FreeAndNil( FStream );

end;

function YExifReader.ExifInf( i: S32 ):string;

var

s : string;

p : PChar;

begin

if i >= Length(FEntrys) then

begin

result := ”;

Exit;

end;

result := FEntrys[i].sDescript + ‘ ‘;

s := ”;

if (FEntrys[i].u16type = 2) or //Ascii or ExifVersion or FlashPixVersion

(FEntrys[i].u16tag = $9000) or (FEntrys[i].u16tag = $A000) then

begin

SetLength( s, FEntrys[i].u32rsize );

Move( FEntrys[i].u32maddr^, s[1], FEntrys[i].u32rsize );

zip格式分析_exif 格式分析_pmp格式分析

end else

begin

if (FEntrys[i].u16tag = $927C) or (FEntrys[i].u16tag = $9286) then

begin //MakerNote or UserComment

s := ‘Not Read.’;

result := result + s;

Exit;

end;

p := AllocMem( FEntrys[i].u32rsize * 2 + 1 );

BinToHex( FEntrys[i].u32maddr, p, FEntrys[i].u32rsize );

s := p;

FreeMem( p );

end;

result := result + s;

end;

end.

;*********************************************************************

;

; TIFF Rev. 6.0 Attribute Information

;

;*********************************************************************

;

;

; A. Tags relating to image data structure

;

256 100 Image width -

257 101 Image height -

258 102 Number of bits per component -

259 103 Compression -

262 106 Pixel composition -

274 112 Orientation of image -

277 115 Number of components -

284 11C Image data arrangement -

530 212 Subsampling ratio of Y to C -

531 213 Y and C positioning -

282 11A Image resolution in width direct -

283 11B Image resolution in height direct -

296 128 Unit of X and Y resolution -

;

; B. Tags relating to recording offset

;

273 111 Image data location -

278 116 Number of rows per strip -

279 117 Bytes per compressed strip -

513 201 Offset to JPEG SOI -

514 202 Bytes of JPEG data -

;

; C. Tags relating to image data characteristics

;

301 12D Transfer function -

318 13E White point chromaticity -

319 13F Chromaticities of primaries -

529 211 Color space transformation matrix -

532 214 Pair of black and white reference -

;

; D. Other tags

;

306 132 File change date and time -

270 10E Image Description -

271 10F Image input equipment maker -

272 110 Image input equipment model -

305 131 Software used -

315 13B Person who created the image -


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-113396-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...