お知らせ

電子会議

ライブラリ

パレット

Delphi FAQ検索

Delphi FAQ一覧

サンプル蔵





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

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

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

【ソース−3】 $920a: 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(Rw1/Rw2); if (Trim(TagName)<>'') and (Trim(TagData)<>'') then begin TagData:=TagData+'mm'; StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $a002: begin TagName:='画像サイズ:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(Word)); if Swp then Rd:=Swap(Rd); Rd:=StrToInt('$'+ Copy(IntToHex(Rd,8),5,4)); DataLength:=DataLength*2; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rd,DataLength); if Swp then Rd:=Swaping(Rd); end; Xsize:=IntToStr(Rd); if (Trim(Xsize)<>'') and (Trim(Ysize)<>'')then begin TagData:=Xsize+'×'+Ysize; StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $a003: begin TagName:='画像サイズ:'; //データの読込 Stream.ReadBuffer(Rd,SizeOf(Word)); if Swp then Rd:=Swap(Rd); Rd:=StrToInt('$'+ Copy(IntToHex(Rd,8),5,4)); DataLength:=DataLength*2; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rd,DataLength); if Swp then Rd:=Swaping(Rd); end; Ysize:=IntToStr(Rd); if (Trim(Xsize)<>'') and (Trim(Ysize)<>'')then begin TagData:=Xsize+'×'+Ysize; StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:=TagName; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=TagData; end; end; $8769: begin Stream.ReadBuffer(Rd,SizeOf(DWord)); if Swp then Rd:=Swaping(Rd); DataLength:=DataLength*4; if DataLength > 4 then begin Stream.Position:=Hd+Rd; Stream.ReadBuffer(Rd,DataLength); if Swp then Rd:=Swaping(Rd); end; Pt:=Hd+Rd-2; Hd2:=Pt; end; end; Pt:=Pt+4; end; end //Exifではない場合 else begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:='Exif情報:'; StringGrid1.Cells[1,StringGrid1.RowCount-1]:='なし'; if GetJpegSize(ExifFile,X,Y) then begin StringGrid1.RowCount:=StringGrid1.RowCount+1; StringGrid1.Cells[0,StringGrid1.RowCount-1]:='画像サイズ:'; StringGrid1.Cells[1,StringGrid1.RowCount-1]:=IntToStr(X)+'×'+ IntToStr(Y); end; end; end; finally Stream.Free; end; Screen.Cursor:=crDefault; end; ---------------------------------------------------------------- Nifty-Mail:JCC01421 Internet-Mail:yun@DigitalPhotoArts.com DigitalPhotoArts:http://www.DigitalPhotoArts.com/ ----------------------------------------------------------------  Original document by Done 氏 ID:(JCC01421)



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

Copyright 1996-2002 Delphi Users' Forum