Announcement

Collapse
No announcement yet.

exif - help needed to set tag

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] exif - help needed to set tag

    Have just started to use exif the set .jpg tag from the command line.
    I just want to add notes to photos.
    This works:-
    ~$ exif --ifd=EXIF --tag 0x9286 --set-value="wednesdayZ" /home/bill/IMAG0151.jpg
    but produces a new file.
    Is there a way to just modify the the existing file?

    #2
    I would...

    I would use the exiftool (package: libimage-exiftool-perl) to edit file metadata from the cli.

    - ExifTool wiki: http://en.wikipedia.org/wiki/ExifTool
    - ExifTool by Phil Harvey: http://www.sno.phy.queensu.ca/~phil/exiftool/
    - Edit image metadata with ExifTool: http://lwn.net/Articles/249461/

    The ExifTool has options to (man exiftool):

    Code:
    ...
             -overwrite_original              Overwrite original by renaming tmp file
             -overwrite_original_in_place     Overwrite original by copying tmp file
             -P          (-preserve)          Preserve date/time of original file
    ...

    Comment


      #3
      Hmm, it looks like it doesn't. Have you tried explicitly setting the --output file as the same as the input? (I'm expecting an error message ...)
      I'd rather be locked out than locked in.

      Comment


        #4
        (dummy post because the forum complained about posting links on my first post)

        Comment


          #5
          As Wheel Inventor posts, there are two options to edit the existing file using exiftool. Your command to atomically replace the original would be:

          exiftool -overwrite_original -usercomment="wednesdayZ" /home/bill/IMAG0151.jpg

          or to actually modify the existing file (not atomic, and vulnerable to corrupting the file if the process is interrupted):

          exiftool -overwrite_original_in_place -usercomment="wednesdayZ" /home/bill/IMAG0151.jpg

          - Phil

          Comment


            #6
            Thanks Phil - that's exactly what I was looking for.
            And thanks for the other ideas also
            Bill

            Comment

            Working...
            X