Mirror large number off CR2 raw images?

Hi all!

I have a large number (>1000) raw images in Canon CR2 format that I need to mirror (flip horizontal). I know how to do that to individual pictures via the orientation module in darkroom but I would like to do this for whole folders. Is there a way to do this from the lighttable? I could only find rotate there but not flip.

Reiner

https://darktable-org.github.io/dtdocs/en/module-reference/processing-modules/orientation/
for one image, then selective copy/paste of history (module orientation) to other images.

1 Like

I wonder if it would be possible to create a style that does this single change and then apply that style to all the 1000+ images in one go. I suspect this is possible.

1 Like

Yeah just make a style or preset and apply it as necessary.

Why do you want to change the “orientation” of raw files? In my opinion that makes no sense. Raw files have no real “orientation” by themselves. They might have a tag in their metadata specifying the orientation. This could of course be changed.
Otherwise, the orientation is normally changed, when a raw file is developed, together with other features of the exported image.

Which is what @reibuehl is doing at the moment (see the first post); he just wanted a method to apply that change to more than one image at a time. Applying a style in the lighttable isn’t that different from applying it in the darkroom.

(I’m also pretty sure the metadata tag does not provide for mirroring the image).

From EXIF tags. These also work with CR2 files, e.g. exiftool -orientation#=7 name.CR2 to mirror an image in portrait orientation.

This will just break the RAW workflow by exporting/importing a JPG/TIFF! A very bad advice if you ask me.

I stand corrected. Then again, changing that tag might not be the best of ideas (writing to raw files, losing the original value which might indicate the original camera orientation, …)

Yes, that’s true. However, if you have a situation where the metadata about the orientation is technically wrong, it might be appropriate to use a script to change the tags accordingly. One should test this of course before applying on the original raw files.

The pictures are digitized analog slides where the process of digitization has “accidentally” mirrored them. As the files are meant for archiving/long term storage, I would like to correct this in the raw image if possible so that I do not have to rely on comments in the metadata or information in XMP sidecar files.

1 Like

I tried changing the orientation field with exiftool but that did not show the expected results when checking the pictures later in Darktable or Irfanview.

It worked for me when I did a test on CR2 files. Could you post an example raw file?

Here is an example.
IMG_0134.CR2 (13.2 MB)

$exiftool IMG_0134.CR2 |grep Orientation
Orientation : Horizontal (normal)
Camera Orientation : Horizontal (normal)

Image(darktable 5.0.0):
IMG_0134

$exiftool -orientation#=4 IMG_0134.CR2
$exiftool IMG_0134.CR2 |grep Orientation
Orientation : Mirror vertical
Camera Orientation : Horizontal (normal)

Image (darktable 5.0.0):
IMG_0134_01

To get the new orientation, you have to freshly import the raw file into darktable. So, either “remove” (not delete!) and reimport or import from a different location.

1 Like

Thanks. I’ll just delete my reply, then, so nobody gets misled.

I think I found my error now! I did use ExiftoolGUI to set the orientation. This did apparently not do what I expected even with removing from and re-adding the pictures to Darktable. After trying it on the command line like you did, the images are shown in the correct orientation.

Many thanks!

Great!