Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exif read/write

Status
Not open for further replies.
Sep 17, 2001
672
US
Does anyone know where I can get a class to read and write to the exif data of a JPG and also do the same type of thing with TIF files? I need to read and edit image description information.
 
I was going to start my own thread on this subject, however, I found this one so I thought I would post my question here. I too, am looking for a way to programatically edit the EXIF data in JPEG photos. I have seen a few ActiveX controls that edit only a certain amount of the EXIF data so I have this feeling that all of the fields could be extracted and Edited. Any Idea where I would start? Thanks.

LF

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
Well, I am farther along with this project now that it is the end of the day. I have found a few different resources that helped me get to a point where I was able to open a JPG file and alter some of the EXIF data. This is a really, really, rough piece of code, but I thought I would post it here for the fundamentals of opening a file as binary. There is another way to do it, but I was not able to get that to work for me. Here is the code. Remember this simply opens a file, any file, and allows a person to see the characters that make up the file.

Option Explicit
Public FileName As String

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Text1.Font = "Terminal"
Text1.OLEDropMode = rtfOLEDropManual
Command1.Caption = "Open"
Command2.Caption = "Save"
End Sub

Private Sub Command1_Click()
' Open
Text1.Text = vbNullString
CD1.ShowOpen
FileName = CD1.FileName
Text1.LoadFile FileName

End Sub

Private Sub Command2_Click()
' Save
If Len(Text1.FileName) Then
Text1.SaveFile Text1.FileName, rtfText
End If
End Sub

Private Sub text1_OLEDragDrop(Data As RichTextLib.DataObject, _
Effect As Long, Button As Integer, Shift As Integer, _
x As Single, y As Single)

' Drag ANY file from the Explorer, or an "Explorer View"
If Data.GetFormat(vbCFFiles) Then
Text1.LoadFile Data.Files(1), rtfText
End If
End Sub


You will need one RichTextBox, 3-command buttons, and a Commondialog control. The Richtextbox I used was named "Text1" since i like it like that, but don't get it confused with the regular textbox. I named my CommonDialog control CD1. You do have the option of opening Windows Explorer and dragging the file into the RichTextBox rather than using the CommonDialog Control. I will post more as I learn more about this EXIF stuff.


LF

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
I know it's cheeky, but how are you doing with editting the exif data? I have had a google, with no real luck, and I was just wondering if you had found the solution to this little problem?

Many thanks

BB
 
The 2 issues that have to be overcome from my perspective is to make sure the image is not corrupted by low level editing and more importantly to be able to distinguish other image types and edit their metadata. If a third party tool can be used in programs and meet these requirements I will be all over it.

Regards,

Rob
 
Hello,
Sorry it has been so long since an update. Things have been happening in my life which did not allow my full attention to this problem.

At any rate, I was able to find a program that would change, and even add, EXIF data to a picture. The whole protocol is complex to say the least which is likely the reasoning there are not more programs devoted to creating EXIF data--I don't know.

The link that I found was the most informational for me was . The full protocol is there in PDF form, as well as a little program called "Photostudio", which is the one I mentioned in the onset of this posting.

I think the key is to modify the Hex data in its most simple form. The protocol tells us what goes where, but actually doing the work is proving to be more difficult for me.

In a few weeks I will have more time to re-explore this issue. I hope this helps a bit.

"As far as the laws of mathematics refer to reality, they are not certain; as far as they are certain, they do not refer to reality."--Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top