Add EXIF Tag to JPEG

Discussion in 'Digital Cameras' started by BluDog, Jun 15, 2004.

  1. BluDog

    BluDog Guest

    Hi

    I was wandering if anyone knew if it was possible to add custom EXIF
    tags (such as Photographer and Title) to a JPEG image, or to modify
    the existing tags (such as ImageDescription).

    There is an extremely good article on Code Project for reading these
    tags, but I cannot find any information on how to modify them:

    http://www.codeproject.com/cs/media/photoproperties.asp

    Thanks

    Blu.
     
    BluDog, Jun 15, 2004
    #1
    1. Advertisements

  2. BluDog

    mphanke Guest

    Hi,

    [I'm writing this assuming you are using C++ .NET]

    this is what I wrote yesterday nite, after I found out you can't create
    and assign PropertyItem to an image. I don't know why this behaviour is
    by design - makes no sense to me, to go the "save and reload then
    modify"-way? Maybe Bob can explain this... ?!?

    You have to write a wrapper in C# to retrieve the codec - also a
    behaviour by design - and also makes no sense to me, I believe MS
    screwed up on this one!

    It should be easy to port that code to any other .NET lang...
    If you have a problem, drop me a line.

    Regards,

    Martin
    [C#-Wrapper for codec retrievement]
    [Fill and Write the comment field:]
    //this is the way to get the property Items
    //retrieve comment from given Commentfield
    //convert to unsigned char array and set
    //required fields for unrestricted user comment


    //string data


    //exif user comment w/o restriction
    //Set the Property item to the selected Image
    //save the image with the properties set
     
    mphanke, Jun 15, 2004
    #2
    1. Advertisements

  3. BluDog

    mphanke Guest

    Hi,

    forgot about this, you might want to download this file and have a look
    at it. There you will find all the valid tag IDs for the Exif2.2 tags.

    http://www.exif.org/Exif2-2.PDF


    Have fun,

    Martin
     
    mphanke, Jun 15, 2004
    #3
  4. BluDog

    BluDog Guest

    forgot about this, you might want to download this file and have a look
    Thanks mate. Looks great, unfortunately I only have knowledge of VB,
    could you give me a hand on the conversion side please?

    Cheers

    Blu
     
    BluDog, Jun 15, 2004
    #4
  5. BluDog

    mphanke Guest

    I don't know much about VB. But you only have to find the appropriate
    calls to the namespace funcs and then replace them... But I will give my
    best to support you on this - give it a try and then post the code and
    tell me where the problem is... I should be able to help you.

    Martin
     
    mphanke, Jun 15, 2004
    #5
  6. BluDog

    Eric Hourant Guest

    Blu,
    You can also use an ocx from WaterMarker.
    Check on www.watermarker.com and follow the AIS Exif ActiveX. I use it for
    reading exif information but it can also be used to write infos.

    HTH

    Eric
     
    Eric Hourant, Jun 15, 2004
    #6
  7. BluDog

    mphanke Guest

    Thanks Eric,

    but I don't use commercial libraries - it's a codex.
     
    mphanke, Jun 15, 2004
    #7
  8. BluDog

    BluDog Guest

    Martin

    I have converted the C# wrapper bit to VB no probs:

    Public Shared Function GetEncoderCodec(ByVal mimetype As String) As
    ImageCodecInfo

    Dim codecs() As ImageCodecInfo =
    ImageCodecInfo.GetImageEncoders()
    Dim codec As ImageCodecInfo

    For Each codec In codecs
    If codec.MimeType = mimetype Then Return codec
    Next

    End Function


    But the rest, this is C++, i am assuming from your post that this can
    only be acheived using C++ and cannot be converted to VB?

    Is this correct?

    Cheers

    Blu
     
    BluDog, Jun 15, 2004
    #8
  9. BluDog

    mphanke Guest

    Hi,

    no this is all .Net standard stuff. You don't have to worry about quit a
    lot of things like the pointer stuff. This is normal object as it is in
    VB. Give it a try, you should encounter no problems.

    I'm leaving office now, if you have any further questions on this, I
    will answer them tomorrow morning.

    Martin
     
    mphanke, Jun 15, 2004
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.