请问怎么读出JPG图片Exif信息或用流读取跳过JPG文件头的图像信息(100)

  • 主题发起人 liyong0775
  • 开始时间
L

liyong0775

Unregistered / Unconfirmed
GUEST, unregistred user!
如题所意1、怎么读取JPG图片Exif信息2、怎么用流读取跳过JPG文件头的图像信息,因为文件头要经常修改,我只想取图像内容来经过MD5运算来得出图像是否被修改过。
 
jpeg文件格式说明:http://hi.baidu.com/memessenger/blog/item/4882aa890056ddb50f24443a.html
 
1、//取Exif信息function GetExifItem(GPImage:TGPImage;ItemID: PROPID): String;var PropSize: UINT; PropItem: PPropertyItem; S:pChar; S1,S2:String;begin PropSize := GPImage.GetPropertyItemSize(ItemID); if PropSize=0 then begin Result:=''; Exit; end; GetMem(PropItem ,PropSize); GPImage.GetPropertyItem(ItemID, PropSize, PropItem); //字符 if PropItem.type_= PropertyTagTypeASCII then begin Result:=PChar(PropItem.Value); end; //分数 if (PropItem.type_= PropertyTagTypeRational) or (PropItem.type_=PropertyTagTypeSRational) then begin S:=PChar(PropItem.Value); S1:=IntToHex(Ord(S[3]),2)+IntToHex(Ord(S[2]),2)+ IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2); S2:=IntToHex(Ord(S[7]),2)+IntToHex(Ord(S[6]),2)+ IntToHex(Ord(S[5]),2)+IntToHex(Ord(S[4]),2); Result:=IntToStr(StrToInt('$'+S1))+'/'+IntToStr(StrToInt('$'+S2)); end; //数字 if PropItem.type_= PropertyTagTypeShort then begin S:=PChar(PropItem.Value); S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2); Result:=IntToStr(StrToInt('$'+S1)); end; //字节{if PropItem.type_= PropertyTagTypeByte then begin S:=PChar(PropItem.Value); S1:=IntToHex(Ord(S[1]),2)+IntToHex(Ord(S[0]),2); Result:=IntToStr(StrToInt('$'+S1)); end;} FreeMem(PropItem);end;
 
TO de410:怎么调用呀,怎么取不出信息。TO znxia: 谢谢,我看看。
 
自已顶一个先。[:D]
 
没大侠出手指点一下吗,2、怎么用流读取跳过JPG文件头的图像信息,因为文件头要经常修改,我只想取图像内容来经过MD5运算来得出图像是否被修改过。分不够另开贴[:)]
 
上来转转,还是没人回贴,借助GdiPlus读写EXIF没有问题,但是图片修改EXIF后再存盘一次,图像信息估计再压缩过,再用MD5运算,得出图片的哈希串已经和上一次的不同,所以还是想通文件流的方式来修改.
 
顶部