お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





FDelphi FAQ
16番会議室「玉石混淆みんなで作るSample蔵」に寄せられたサンプル

"RE:JPEGファイルからExifのデータを取得・"

この発言は
#01347 河邦 正 さんのJPEGファイルからExifのデータを取得・表示
に対するコメントです

【ソース−2】 if DataLength > 4 then begin Stream.Position:=Hd+Rd; for K:=1 to DataLength do begin Stream.ReadBuffer(Rt,Sizeof(Byte)); if Rt > 19 then S:=S+Chr(Rt); end; TagData:=S; end else begin Stream.Position:=Pt-4; for K:=1 to DataLength do begin Stream.ReadBuffer(Rt,Sizeof(Byte)); if Rt > 19 then S:=S+Chr(Rt); end; TagData:=S; end; if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $9102: begin TagName:='JPEG圧縮率:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*8; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rw1,SizeOf(DWord)); Stream.Position:=Hd+Rd+4; Stream.ReadBuffer(Rw2,SizeOf(DWord)); if Swp then begin Rw1:=Swaping(RW1); Rw2:=Swaping(Rw2); end; end; TagData:=IntToStr(Trunc(Rw1/Rw2))+'/1'; if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin TagData:=TagData; StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $9201: begin if not SFg then begin TagName:='シャッター速度:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*8; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rw1,SizeOf(DWord)); Stream.Position:=Hd+Rd+4; Stream.ReadBuffer(Rw2,SizeOf(DWord)); if Swp then begin Rw1:=Swaping(RW1); Rw2:=Swaping(Rw2); end; end; TagData:='1/'+FloatToStr(Round(Power(2,Rw1/Rw2))); if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; end; $9202: begin if not AFg then begin TagName:='絞り値:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*8; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rw1,SizeOf(DWord)); Stream.Position:=Hd+Rd+4; Stream.ReadBuffer(Rw2,SizeOf(DWord)); if Swp then begin Rw1:=Swaping(RW1); Rw2:=Swaping(Rw2); end; end; TagData:=FloatToStr(Round(Sqrt(Power(2,Rw1/Rw2))*10)/10); if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; end; $9204: begin TagName:='露出補正:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*8; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rw3,SizeOf(Integer)); Stream.Position:=Hd+Rd+4; Stream.ReadBuffer(Rw2,SizeOf(DWord)); if Swp then begin Rw3:=Swaping(RW3); Rw2:=Swaping(Rw2); end; end; TagData:=FloatToStr((Round((Rw3/Rw2)*10))/10)+'(EV)'; if Round((Rw3/Rw2)*10) > 0 then TagData:='+'+TagData; if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $9205: begin TagName:='開放F値:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*8; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rw1,SizeOf(DWord)); Stream.Position:=Hd+Rd+4; Stream.ReadBuffer(Rw2,SizeOf(DWord)); if Swp then begin Rw1:=Swaping(RW1); Rw2:=Swaping(Rw2); end; end; TagData:=FloatToStr(Round(Sqrt(Power(2,Rw1/Rw2))*10)/10); if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $9207: begin TagName:='測光モード:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(Word)); if Swp then Rd:=Swap(Rd); Rd:=StrToInt('$'+ Copy(IntToHex(Rd,8),5,4)); DataLength:=DataLength*2; case Rd of 1: TagData:='平均測光'; 2: TagData:='中央部重点測光'; 3: TagData:='スポット測光'; 4: TagData:='多点スポット測光'; 5: TagData:='マルチパターン測光'; else TagData:='不明'; end; if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $9209: begin TagName:='フラッシュ発光:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(Word)); if Swp then Rd:=Swap(Rd); Rd:=StrToInt('$'+ Copy(IntToHex(Rd,8),5,4)); DataLength:=DataLength*2; case Rd of 0: TagData:='OFF'; 1: TagData:='ON'; else TagData:='不明'; end; if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end;  Original document by Done 氏 ID:(JCC01421)



ここにあるドキュメントは NIFTY SERVEの Delphi Users' Forum の16番会議室「玉石混淆みんなで作るSample蔵」に投稿されたサンプルです。これらのサンプルはボーランド株式会社がサポートする公式のものではありません。また、必ずしも動作が検証されているものではありません。これらのサンプルを使用したことに起因するいかなる損害も投稿者、およびフォーラムスタッフはその責めを負いません。使用者のリスクの範疇でご使用下さい。

Copyright 1996-2002 Delphi Users' Forum