Main Menu

XMP-dc: Subject

Started by prestonmcafee, May 24, 2024, 12:33:22 PM

Previous topic - Next topic

prestonmcafee

I'm trying to erase a field XMP-dc: Subject.  The relevant section from the exiftool list:

---- XMP-dc ----
Subject                        : Toni, Zoe Phelps, Sophie
Title                          :
Description                    :

I'm running exiftool using python and the relevant piece is

keywords = ""
subject = ""
files = [docroot+'2005/Apr/66.jpg']
with exiftool.ExifToolHelper() as et:
    # Execute the exiftool
    et.execute(
        f'-EXIF:XPKeywords={keywords}',
        f'-XMP-dc:Subject=subject',
        f'-overwrite_original',
        *files
    )

The code eliminates XPKeywords successfully on jpgs that have that entry, which makes me think the problem is my target of XMP-dc:Subject, but I'm a newbie with exiftool.  I attach the original image and the exiftool output.  Once I learn how to do this, I will apply to 36K images as well as know more about exiftool.

StarGeek

On the command line
C:\>exiftool -P -overwrite_original -subject= Y:\!temp\x\66.jpg
Warning: [Minor] Improperly enclosed XMP property: x:xmpmeta/rdf:RDF/unnamed - Y:/!temp/x/66.jpg
    0 image files updated
    1 image files unchanged

Including the -m (-ignoreMinorErrors) option will probably fix it, but there's the possibility of losing some data.

Also, since you're planning on running it on such a large number of images, I would suggest using the PyExiftool wrapper. Running exiftool once for each file is Common Mistake #3 and can significantly increase the processing time, as exiftool's startup time is the biggest performance hit. PyExiftool keeps exiftool running in the background via the -stay_open option and avoids the startup performance hit.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

prestonmcafee

First, worked a charm, THANK YOU!

Second, I plan to try pyexiftool but wanted to first ensure I could actually do something useful! :)