how to edit with commandline the comment and tag property details of file in dolphin

using dolphin Version 19.08.2 and plasma 5.17.0
rightclicking on a file and choosing >properties>details tab I have many informations on the file like here:
https://susepaste.org/10649006
how can I edit the comment and tag field using commandline?
which kind of information ere these? are comment and tag field viewable only in dolphin? only in kde? only in linux? or everywhere in linux mac windows oses?
manythanka :slight_smile:

Sorry when I interpreted this wrong, but my idea of what you ask is: How do I edit the Comment field in a JPEG file.

Look at the progam jhead. I do not know if it is installed by default. It is in the OSS repo, thus using YaST > Software Management or (as root):

zypper in jhead

will install it. And then of course

man jhead

it seems some misunderstanding is present :slight_smile:
first I modified the comment field with jhead in “comment jhead”

pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)/orig> jhead -cl "comment  jhead" prova.jpeg 
Modified: prova.jpeg
pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)/orig> 

and nothing was shown in dolphin>properties>details
then I modified the comment using dolphin>properties>detail tab in “dolphin comment” but nothing appear on jhead

pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)/orig> jhead prova.jpeg 
File name    : prova.jpeg
File size    : 542921 bytes
File date    : 2019:10:21 14:13:36
Camera make  : SAMSUNG
Camera model : GT-I9195
Date/Time    : 2017:08:12 18:08:05
Resolution   : 3264 x 1836
Orientation  : rotate 90
Flash used   : No
Focal length :  3.7mm
Exposure time: 0.059 s  (1/17)
Aperture     : f/2.6
ISO equiv.   : 125
Whitebalance : Auto
Metering Mode: average
Exposure     : aperture priority (semi-auto)
GPS Latitude : ? ?
GPS Longitude: ? ?
JPEG Quality : 80
Comment      : comment  jhead

pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)/orig> 

then I modified again the comment using jhead and the comment in dolphin>properties>details disappeared

Well, the use of high level GUI tools hides a lot. The result can be a lot of misunderstanding by the tool users.

All the items in that Dolphin property list below comment are typical JPEG items (either JPEG specific, or belonging to the EXIF).
No we know there can be a “comment” item in the JPEG header (which you proved), but I have no idea if that is the same Comment show by Dolphin, or if Dolhin gets it from another place.

So the ultimate question is if you want to change the comment in the JPEG header, or if you want to change the comment shown in Dolphin (which maybe the same, or derived from it originaly and stored elsewhere, or something completely different, who knows what GUI tools all do do to obfuscate reality).

I am a bit guessing here because I never looked into those details that Dolphin offers.

Because I see that Comment item shown with all types of files (even plain text files), I get the idea it is something Dolphin stores somewhere. The same with the items Tags and Ratings. They are not things that are stored in a plain text file itself, thus they only exist in Dolphins own imaginary.
I do not know whwre these is stored, nor if you can edit them easy from the command line.

I would recommend first determining if the values you see are EXIF (I think likely)
Install and run exiftools and point it to your file. You should then have your answer, if it displays the same info as in Dolphin or not.

If you don’t see the same information, then of course it’s likely that the values are stored in your file system (BTFRS? Something else?), in which case you’ll need to do some research into what tools might provide access to that metadata… I don’t know how accessible those values might be without special tools, could require knowledge of the file system at a low level.

Otherwise, if those values are EXIF, then there are a number of known tools that can edit directly.

TSU

Nothing to do with filesystems or such. It’s baloo, the file indexer that adds configured tags. As some kind of proof: you will see the same tags f.e. in file dialogs.

It is the same comment tha appear in the field description in the file opened in gwenview, so it seems that it is more KDE applications viewed by

I would like to have my pictures with a comment readable everywhere, it seems that the one in dolphin is useful only in linux filesystem and dolphin (I tried to copy files in a pen drive probably with ntfs filesystem and the field >properties>details>comments is not editable)
the comment in jhead is visible mostly everywhere, so I think to adopt both

Oh yes, the comment you can manipulate with jhead (and other JPEG and image editing tools) is part of the file and travels with it everywhere. The comment you see in Dolphin is, as Knurpht explains, part of de KDE environment (maybe it is a desktop.org standard and thus works in more desktops then KDE alone) and as such will not travel with the file.

The problem here is that the mere English term “Comment” does fit both. Adding to this the other typical JPEG values like size and the EXIF values from the camera makes it more difficult to see what the meanng of Comment is here. :frowning:

Pier, you’re looking for EXIF tags. Use Digikam f.e. to add / change those. Or, if mass changes are required, use a script that calls the ImageMagick tools.

The Comment in a JPEG file is not part of the EXIF data (which can also be in a JPEG file).

See also

man jhead

which the OP already uses (see above) and which is perfect for doing mass actions on both the EXIF data and on the other meta data of the image inside a JPEG file.

maaaanythanks, fantastic digikam! I’ll use few of the manymany things that it does just 20minutes for learn something but it is very good

if I insert a comment or description with dolphin or gwenview it is removed when I modify the commnt with jhead

pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)> jhead -cl "comment jhead" prove.jpg
Modified: prove.jpg
pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)> jhead prove.jpg
File name    : prove.jpg
File size    : 201595 bytes
File date    : 2019:10:23 09:39:54
Resolution   : 1600 x 1200
JPEG Quality : 80
Comment      : comment jhead
======= IPTC data: =======
City          : 
Caption       : caption inserita con digikam2

pla@pla4-TW:/dati/a-FOTO-x-amici/2017-08-12ago(pizzata a casa di cugina consuelo velletri)> 

and in gwenview I cas see this
Comment:
comment jhead
User Comment:
lang=“x-default” caption inserita con digikam2
Description is empty

is it a correct behaviour or not?