Darktable image export WITHOUT exif data?

Any idea if it is possible to export from darktable without including exif data?

As it is now I get rid of exif data in GIMP, but it seems like an unnecessary extra item in the workflow!

GärupS

It’s not possible. I have tried to rework the EXIF API, but it needs to change functions that are called in multiple place in the code, so it’s a tedious process because one would have to parse the whole function calls tree to repercute changes, and that lib is ugly.

Using a lua script which runs after export could be an option.

I create this script which calls the exiftool on the exported image with the selected argument.

I mainly use it to copy exif tags to IPTC. The option ‘all=’ should strip all metadata. The script get excuted before the image get moved to its final export destination. So it works for me with flickr export as well …

2 Likes

It would be ‘yet another tool’, but I wrote output parameters to do precisely that in my img command line program. I use it to make really small thumbnails like this:

~/$ img "*.jpg" resize:120 "thumbs/*.jpg:quality=75;excludeexif;excludeicc"

This would batch-produce thumbnail images in a thumbs/ subdirectory.

The latest release downloads are here:

The Windows installers will install img and add it’s location to the PATH, if you use the AppImage, put it in your /usr/local/bin directory and make a symbolic link to it like this:

/usr/local/bin/$ sudo ln -s rawproc...AppImage img

And then you can run img with just it’s name.

As @pk5dark said, I would use exiftool or exiv2. Using a lua script with either is even simpler.

Hi again,

Thanks for all the replies :slight_smile:

Not being a programmer I naively thought NOT adding EXIF data to export was easier than adding it?

In GIMP you just deselect the EXIF, XMP and IPTC during the export process!

Couldn’t that be a feature in Darktable as well?

It should be, but given the state of the code that does it, it’s actually not as straightforward as it sounds, and that explains why this has never been done even if asked for many years.

1 Like

Ok, thanks, guess we’ll just have to wait and cross our fingers, that it is included in some future update then :slight_smile:

PD

Is there somewhere one could send improvement proposals for Darktable?

https://redmine.darktable.org/projects/darktable/issues

There is already a feature request that asks just that somewhere in dt issue tracker.

It would be incredibly nice if all editing softwares and especially all raw processors would allow to not export exif/xmp/etc data (with the “comment” field apparently going under “etc”).

There is one bit of metadata that GIMP doesn’t (yet?) allow to automatically not export, and that’s the comment field. Apparently many file types have their own file-type-specific “comment” field, which I totally didn’t realize - I just always assumed there was one “comment” field that was part of exif data.

How GIMP currently handles the comment field does vary from one file type to another:

darktable currently puts in the comment field something like the following:

Developed using darktable 2.5.0+980~g06471ce73

@anon41087856 - would it be possible to put in darktable preferences the option to disable adding any content to comment fields? Or is this also inextricably intertwined with the rest of the exif and other metadata?

The output exif writing relies on a bunch of nested functions that are called several times since there are at least 2 variants of the output pipeline (TIFF and rest of the world if I recall). So one would have to unknit that thread first, then follow it to repercute the changes through several functions. That code is really unmaintainable. I tried, thinking it would be simple (deleting class properties should be easy), but I gave up after a few hours of treasure quest.

That’s why they say “write APIs, not code”.

https://redmine.darktable.org/issues/8421

8 years old, duplicated 6 and 2 years ago.

Hmm, well, maybe this won’t help in case some very brave person wants to tackle darktable handling of exif and other metadata. But maybe it will. Not too long ago it seems digiKam handling of metadata was completely revamped. The digiKam UI now provides the most granular handling of metadata I’ve ever seen, so possibly the digiKam metadata code might serve as a model or guide.

Normally I’ve been using the following exiftool command to remove all metadata before uploading images to the web. Or at least I thought I was removing all metadata:

exiftool -all= filename.extension

But checking a tif exported from GIMP with the darktable “comment” in it, after removing (I thought) all the metadata and checking to see what was left, the darktable “comment” - which is actually written to “ImageDescription” field at least for tiffs - was left behind:

$ exiftool -s -G comment-test.tif
[ExifTool]      ExifToolVersion                 : 11.03
[File]          FileName                        : comment-test.tif
[File]          Directory                       : .
[File]          FileSize                        : 116 MB
[File]          FileModifyDate                  : 2018:12:12 14:31:37-05:00
[File]          FileAccessDate                  : 2018:12:12 14:31:37-05:00
[File]          FileInodeChangeDate             : 2018:12:12 14:31:37-05:00
[File]          FilePermissions                 : rw-r--r--
[File]          FileType                        : TIFF
[File]          FileTypeExtension               : tif
[File]          MIMEType                        : image/tiff
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[EXIF]          ImageWidth                      : 3906
[EXIF]          ImageHeight                     : 2602
[EXIF]          BitsPerSample                   : 32 32 32
[EXIF]          Compression                     : Uncompressed
[EXIF]          PhotometricInterpretation       : RGB
[EXIF]          DocumentName                    : /home/elle/comment-test.tif
[EXIF]          ImageDescription                : Developed using darktable 2.5.0+980~g06471ce73
[EXIF]          Orientation                     : Horizontal (normal)
[EXIF]          SamplesPerPixel                 : 3
[EXIF]          RowsPerStrip                    : 128
[EXIF]          XResolution                     : 300
[EXIF]          YResolution                     : 300
[EXIF]          PlanarConfiguration             : Chunky
[EXIF]          ResolutionUnit                  : inches
[EXIF]          SubfileType                     : Reduced-resolution image
[EXIF]          StripOffsets                    : 686
[EXIF]          StripByteCounts                 : 130560
[EXIF]          SampleFormat                    : Float; Float; Float
[EXIF]          ThumbnailTIFF                   : (Binary data 130776 bytes, use -b option to extract)
[Composite]     ImageSize                       : 3906x2602
[Composite]     Megapixels                      : 10.2

Notice some of the metadata can’t actually be removed and that’s OK, it’s used to identify the file type and such.

But the “ImageDescription” tag (that says "Developed using darktable . . . " shouldn’t be one of these non-removeable tags, it seems to me. And the tag really can be removed using exiftool, like this:

exiftool -ImageDescription= comment-test.tif

Anyone using exiv2 or exiftool and lua to remove tags, it might be good to check to see what all is left behind, that you might actually want to remove. All these years of using exiftool to strip metadata, and I had no idea the “ImageDescription” tag was being left behind, if some software had actually written to this field.

FWIW, the exif “ImageDescription” tag is supposed to actually be the title of the image, though sometimes it’s used as a place to put comments.

If this tag is already filled by an actual image description, I wonder what darktable does - does it overwrite the existing text? Add to the existing text?

I recall the docs saying that not all IFD0 tags are removed by -all=.

It is something worth exploring. :wink: I am guessing most apps would just overwrite it.

Hmm, you are right - thanks! See this page FAQ#7:

https://www.sno.phy.queensu.ca/~phil/exiftool/faq.html

Also see the “CommonIFD0” “shortcut” tag on this page, allowing to remove all the following IFD0 tags at once:

https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Shortcuts.html

IFD0:ImageDescription
IFD0:Make
IFD0:Model
IFD0:Software
IFD0:ModifyDate
IFD0:Artist
IFD0:Copyright
IFD0:Rating
IFD0:RatingPercent
IFD0:DNGLensInfo
IFD0:PanasonicTitle
IFD0:PanasonicTitle2
IFD0:XPTitle
IFD0:XPComment
IFD0:XPAuthor
IFD0:XPKeywords
IFD0:XPSubject

About this lua script thing for removing unwanted metadata:

When using GIMP to open a raw file using the darktable plug-in, can a lua script be used to remove all the unwanted metadata - during the process of interpolating the raw file and passing the resulting image file to GIMP - so the metadata never gets to GIMP in the first place?

If yes, how? step by step please! Again, the goal is having the image transferred from darktable to GIMP via the darktable GIMP plug-in, with the unwanted metadata already removed.

@Elle
Gimp uses this Lua script to export the image from dt. You could try to add the metadata cleaner here:

And here is an example of using exiftool in a dt Lua script:

I hop this brings you a step further.

3 Likes

Hi again,

Thanks for all the input!

I found this (https://trimage.org/) little program in the ubuntu-studio repository!
It batch removes exif data and compresses the files!
I didn’t find any settings to play with?
But it seems to do the job :slight_smile:

1 Like