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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to add comments to a JPG image?

Status
Not open for further replies.

PPettit

IS-IT--Management
Sep 13, 2003
511
US
Does anyone know of a way to add a comment to the details tab of a JPG image?

I've tried using DSOFile, but it doesn't appear to work with anything but Microsoft Office documents.
 

details tab of a JPG image

Could you elaborate on this?


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
In Windows 7, right-click a JPG, select "Properties", select the "Details" tab.

In Windows XP, right-click on a JPG, select "Properties", select the "Summary" tab.

For both, I need to be able to edit the "Comments" field in the "Description" section.
 
Ah, got it. This data is not stored in Windows, but is actually stored in the image file itself. It is called EXIF (Exchangeable Image File Format), and to make changes to it you will have to edit the image file.

I think your best bet is to get an EXIF library for .NET and use that in your project. There are several out there, many free. Here's an example of a free one:


I've not used this myself, so I can't make any statement as to how good it is. You can Google "vb .net exif library" (without the quotes) and find other EXIF libraries.

Good luck!


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
I've been messing around with the ExifWorks class but haven't been able to figure out how make it work properly.

In order to make it function at all, I changed this:
Code:
Private _Image As System.Drawing.Bitmap
to this:
Code:
Public _Image As System.Drawing.Bitmap

For a quick test, I've been using this:
Code:
Public Class EXIFtest
    Dim ef As New ExifWorks("c:\test\test.jpg")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim imgWithExif As Image = ef._Image
        ef.Description = "blah"
        imgWithExif.Save("c:\test\testwithexif.jpg")
    End Sub
End Class

The word "blah" does not appear anywhere when you view the properties of the file. However, if you open the jpeg with Notepad you can clearly see that it was written into the file.

Any idea as to how to make this work as desired?
 

Hey thanks, it's really cool when people come back to share their solutions. I'm glad you got it working.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top