This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Where are saved the comments of a jpeg picture ?

Tags: None
(comma "," separated)
kdelex
Registered Member
Posts
2
Karma
0
Hi all !

Discovering the file manager Dolphin, I am surprised that for the pictures, some tag are displayed, especially the comment.
I write a comment on Dolphin through the properties of the file as below :
Image
and then I complete the comment from Gwenview
Image

I use the exiv2 command to list all the tag (exif, iptc, xmp), but I cannot find this comment that I wrote from Dolphin and Gwenview :
"Wirting a comment from Gwenvien and then from Dolphin"

Code: Select all
kfocal@kfocal:~/.kde/share/config$ exiv2 -p a  P_20210207_160824.jpg
Exif.Image.ImageWidth                        Long        1  4656
Exif.Image.ImageLength                       Long        1  2620
Exif.Image.ImageDescription                  Ascii      31  writing a caption from Digikam
Exif.Image.Make                              Ascii       5  asus
Exif.Image.Model                             Ascii      11  ASUS_Z017D
Exif.Image.XResolution                       Rational    1  72
Exif.Image.YResolution                       Rational    1  72
Exif.Image.ResolutionUnit                    Short       1  inch
Exif.Image.Software                          Ascii       8  Android
Exif.Image.DateTime                          Ascii      20  2021:02:07 16:08:24
Exif.Image.YCbCrPositioning                  Short       1  Centered
Exif.Image.ExifTag                           Long        1  264
Exif.Photo.ExposureTime                      Rational    1  1/60 s
Exif.Photo.FNumber                           Rational    1  F2
Exif.Photo.ExposureProgram                   Short       1  Not defined
Exif.Photo.ISOSpeedRatings                   Short       1  54
Exif.Photo.ExifVersion                       Undefined   4  2.20
Exif.Photo.DateTimeOriginal                  Ascii      20  2021:02:07 16:08:24
Exif.Photo.DateTimeDigitized                 Ascii      20  2021:02:07 16:08:24
Exif.Photo.ComponentsConfiguration           Undefined   4  YCbCr
Exif.Photo.ShutterSpeedValue                 SRational   1  1/60 s
Exif.Photo.ApertureValue                     Rational    1  F2
Exif.Photo.BrightnessValue                   SRational   1  0
Exif.Photo.ExposureBiasValue                 SRational   1  0 EV
Exif.Photo.MeteringMode                      Short       1  Center weighted average
Exif.Photo.Flash                             Short       1  No, compulsory
Exif.Photo.FocalLength                       Rational    1  4.0 mm
Exif.Photo.MakerNote                         Undefined 20849  (Binary value suppressed)
Exif.Photo.UserComment                       Undefined  38  writing a caption from Digikam
Exif.Photo.SubSecTime                        Ascii       7  228998
Exif.Photo.SubSecTimeOriginal                Ascii       7  228998
Exif.Photo.SubSecTimeDigitized               Ascii       7  228998
Exif.Photo.FlashpixVersion                   Undefined   4  1.00
Exif.Photo.ColorSpace                        Short       1  sRGB
Exif.Photo.PixelXDimension                   Long        1  4656
Exif.Photo.PixelYDimension                   Long        1  2620
Exif.Photo.InteroperabilityTag               Long        1  21658
Exif.Iop.InteroperabilityIndex               Ascii       4  R98
Exif.Iop.InteroperabilityVersion             Undefined   4  1.00
Exif.Photo.ExposureIndex                     Rational    1  0/6
Exif.Photo.SensingMethod                     Short       1  One-chip color area
Exif.Photo.SceneType                         Undefined   1  Directly photographed
Exif.Photo.ExposureMode                      Short       1  Auto
Exif.Photo.WhiteBalance                      Short       1  Auto
Exif.Photo.SceneCaptureType                  Short       1  Standard
Exif.Image.GPSTag                            Long        1  21688
Exif.GPSInfo.GPSAltitudeRef                  Rational    1  (200/100)
Iptc.Envelope.CharacterSet                   String      3 
Iptc.Application2.ObjectName                 String     28  writing a title from Digikam
Iptc.Application2.Caption                    String     30  writing a caption from Digikam
Xmp.acdsee.caption                           XmpText    28  writing a title from Digikam
Xmp.acdsee.notes                             XmpText    30  writing a caption from Digikam
Xmp.dc.title                                 LangAlt     1  lang="x-default" writing a title from Digikam
Xmp.dc.description                           LangAlt     1  lang="x-default" writing a caption from Digikam
Xmp.digiKam.CaptionsDateTimeStamps           LangAlt     1  lang="x-default" 2021-03-10T14:57:26
Xmp.exif.UserComment                         LangAlt     1  lang="x-default" writing a caption from Digikam
Xmp.tiff.ImageDescription                    LangAlt     1  lang="x-default" writing a caption from Digikam
kfocal@kfocal:~/.kde/share/config$


As you could see in the result of the exiv2 command, I also tested the comments from Digikam. From Digikam, it is okay. I could identify where the comments are stored but not for Dolphin/Gwenview.

Do you any idea where are stored the comments written from Dolphin/Gwenview ?

DE : KDE Plasma : 5.18
Gwenview : V19.12.3
User avatar
pvzh
Registered Member
Posts
24
Karma
1
OS
You can track the file activity of a process:
Code: Select all
$ strace -f -e trace=file /usr/bin/gwenview /home/user/Pictures/test.jpg
. . .
[pid 138365] setxattr("/home/user/Pictures/test.jpg", "user.xdg.comment", "This is comment", 15, 0) = 0


As you can see, the comment is stored as an extended attribute in the file system.

Code: Select all
$ man xattr
. . .
Extended attributes are name:value pairs associated permanently with files and directories...
kdelex
Registered Member
Posts
2
Karma
0
Thank you so much for your help and for teaching me how to fish.

I wrote a little script to transfer the comments into the jpeg files for a compatibility with Digikam, and my Piwigo photo portal.
Code: Select all
for file in $(ls -1 *.jpg);
do
    comment=$(xattr -p user.xdg.comment $file 2>/dev/null)
    if [ ${#comment} -ne 0 ];
    then
        echo "comment : $comment => ${#comment}"
        exiv2 -M"add Iptc.Application2.Caption String $comment" $file
        exiv2 -M"add Exif.Image.ImageDescription Ascii $comment" $file
    fi
done


According to you, would it be possible to set gwenview to write directly the comments in the EXIF or IPTC tag of the jpeg files ?

PS : I was a little long to answer :o


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]