To remove all but a certain tag that has spaces in its name

Started by jsx97, May 28, 2024, 06:16:06 AM

Previous topic - Next topic

jsx97

To remove all but a certain tag that doesn't have spaces in its name, e.g., foo, I use

exiftool -overwrite_original_in_place -all= -tagsfromfile @ -foo input.jpg

But how to remove all but a certain tag that does have spaces in its name, e.g., foo bar? I have tried both

exiftool -overwrite_original_in_place -all= -tagsfromfile @ -"foo bar" input.jpg

exiftool -overwrite_original_in_place -all= -tagsfromfile @ "-foo bar" input.jpg

but neither seems to work.

StarGeek

No tag has spaces in its name.  Please read FAQ #2/3
QuoteWhen you run exiftool, by default it prints descriptions, not tag names
...
Note that descriptions often contain spaces between words, but tag names never do.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jsx97

Many thanks, StarGeek.

exiftool -a -g1 -sort 1.jpg

returns

---- ExifTool ----
ExifTool Version Number         : 12.76
---- System ----
Directory                       : .
File Access Date/Time           : 2024:05:28 17:11:03+03:00
File Inode Change Date/Time     : 2024:05:28 17:11:01+03:00
File Modification Date/Time     : 2024:05:12 21:15:07+03:00
File Name                       : 1.jpg
File Permissions                : -rw-r--r--
File Size                       : 273 kB
---- File ----
Bits Per Sample                 : 8
Color Components                : 3
Current IPTC Digest             : 717964420d38c85f3238d694cec521ca
Encoding Process                : Baseline DCT, Huffman coding
Exif Byte Order                 : Big-endian (Motorola, MM)
File Type                       : JPEG
File Type Extension             : jpg
Image Height                    : 1568
Image Width                     : 2350
MIME Type                       : image/jpeg
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
---- JFIF ----
JFIF Version                    : 1.01
Resolution Unit                 : None
X Resolution                    : 72
Y Resolution                    : 72
---- ExifIFD ----
Exif Image Height               : 1568
Exif Image Width                : 2350
---- XMP-x ----
XMP Toolkit                     : XMP Core 6.0.0
---- XMP-dc ----
Subject                         : Photo Booth
---- IPTC ----
Application Record Version      : 2
Coded Character Set             : UTF8
Keywords                        : Photo Booth
---- Photoshop ----
IPTC Digest                     : 717964420d38c85f3238d694cec521ca
---- ICC-header ----
CMM Flags                       : Not Embedded, Independent
Color Space Data                : RGB
Connection Space Illuminant     : 0.9642 1 0.82491
Device Attributes               : Reflective, Glossy, Positive, Color
Device Manufacturer             : Apple Computer Inc.
Device Model                    :
Primary Platform                : Apple Computer Inc.
Profile CMM Type                : Apple Computer Inc.
Profile Class                   : Display Device Profile
Profile Connection Space        : XYZ
Profile Creator                 : Apple Computer Inc.
Profile Date Time               : 2024:04:16 17:59:49
Profile File Signature          : acsp
Profile ID                      : 0
Profile Version                 : 2.1.0
Rendering Intent                : Perceptual
---- ICC_Profile ----
Blue Matrix Column              : 0.1571 0.06657 0.78407
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Green Matrix Column             : 0.29198 0.69225 0.04189
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Make And Model                  : (Binary data 40 bytes, use -b option to extract)
Media White Point               : 0.95045 1 1.08905
Native Display Info             : (Binary data 62 bytes, use -b option to extract)
Profile Copyright               : Copyright Apple Inc., 2024
Profile Description             : Display
Profile Description ML          : Warna LCD
Profile Description ML          : ‏LCD ملونة
Profile Description ML          : LCD Warna
Profile Description ML          : Color LCD
Profile Description ML (ca-ES)  : LCD en color
Profile Description ML (cs-CZ)  : Barevný LCD
Profile Description ML (da-DK)  : LCD-farveskærm
Profile Description ML (de-DE)  : Farb-LCD
Profile Description ML (el-GR)  : Έγχρωμη οθόνη LCD
Profile Description ML (en-AU)  : Colour LCD
Profile Description ML (en-GB)  : Colour LCD
Profile Description ML (es-ES)  : LCD a color
Profile Description ML (es-XL)  : LCD color
Profile Description ML (fi-FI)  : Väri-LCD
Profile Description ML (fr-CA)  : ACL couleur
Profile Description ML (fr-FR)  : LCD couleur
Profile Description ML (he-IL)  : ‏LCD צבעוני
Profile Description ML (hi-IN)  : रंगीन LCD
Profile Description ML (hr-HR)  : LCD u boji
Profile Description ML (hu-HU)  : Színes LCD
Profile Description ML (it-IT)  : LCD a colori
Profile Description ML (ja-JP)  : カラーLCD
Profile Description ML (ko-KR)  : 컬러 LCD
Profile Description ML (nb-NO)  : Farge-LCD
Profile Description ML (nl-NL)  : Kleuren-LCD
Profile Description ML (pl-PL)  : Kolor LCD
Profile Description ML (pt-BR)  : LCD Colorido
Profile Description ML (pt-PT)  : LCD a cores
Profile Description ML (ro-RO)  : LCD color
Profile Description ML (ru-RU)  : Цветной ЖК-дисплей
Profile Description ML (sk-SK)  : Farebný LCD
Profile Description ML (sv-SE)  : Färg-LCD
Profile Description ML (th-TH)  : LCD สี
Profile Description ML (tr-TR)  : Renkli LCD
Profile Description ML (uk-UA)  : Кольоровий LCD
Profile Description ML (vi-VN)  : LCD Màu
Profile Description ML (zh-CN)  : 彩色LCD
Profile Description ML (zh-TW)  : 彩色LCD
Red Matrix Column               : 0.51512 0.2412 -0.00105
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Video Card Gamma                : (Binary data 48 bytes, use -b option to extract)
---- Composite ----
Image Size                      : 2350x1568
Megapixels                      : 3.7

From what the FAQ says, it seems entries in the left column, such as, for example, XMP Toolkit are tag descriptions, not the tags themselves, correct?

But then another question: how to detect which tag corresponds to a certain description?

StarGeek

Quote from: jsx97 on May 28, 2024, 10:17:24 AMBut then another question: how to detect which tag corresponds to a certain description?

You have not used the command in either FAQ #2 or #3. Both of those include the -s (-short) option, not the -sort option.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

jsx97