Opinions wanted: Would the ability to rename image files within Darktable be useful?

does that mean that I have to type .$(FILE_EXTENSION) each time? If that was the case I would find typing the file extension myself quicker. Thanks for the reply.

If you rename images one by one yes. If you select a bunch of images and want to rename them to 20230930-$(FILE_NAME).$(FILE_EXTENSION) then using the variables makes sense.

Thanks Bill. It really isn’t a big problem typing the file extension so I will do that. I truly appreciate you having written such a useful lua script. BTW, I often rename my images on import to include location details in name, but this script of yours is great for naming copies of images to use in my classes.

I hope it is ok to resurrect this thread; I had a question related to the rename_images.lua script and this is more or less in-topic.

First, I understand that you mostly don’t need any renaming with darktable, so I totally get what most of the people here are saying, but sometimes I need to dig into the filesystem so file names (and renaming) are important to me.

What I realized now in 4.6 (not sure if this was the same also in earlier versions) is that dt’s variables (darktable 4.6 user manual - variables) are not the same as the one used in the script.

So when doing copy & import I use this pattern to rename files:

$(EXIF.YEAR)$(EXIF.MONTH)$(EXIF.DAY)$(FILE.NAME#IMG).$(FILE_EXTENSION)

to rename files like IMG_6222.JPG to 20230210_6222.JPG, relying on the string substitution magic $(var#pattern) to delete IMG from the filename.

However the same pattern won’t work in rename_images first because

  • the variable names are different: $(EXIF_YEAR) instead of $(EXIF.YEAR)
  • there is no string substitution magics

I thought that all these variables and magics are “core” so they would work in main darktable and within LUA scripts too, but evidently they’re not.

I wonder if @wpferguson has time to look at it? If there’s something I can do let me know. And thanks!

1 Like

It’s already in the works, Add substitution to string lib by wpferguson · Pull Request #412 · darktable-org/lua-scripts · GitHub. I just need to get the tag substitution working and add the new variables that have been added to darktable in the last year.

2 Likes

thank you Bill! I did have a quick look in the github issues but couldnt find this – sorry I should’ve looked better!

@wpferguson thanks for your work with this LUA script. It is brilliant for what I want.

I think it will be a useful feature, especially when we create duplicates in lighttable. At the moment, it is not easy to differentiate which is which. A file rename option will certainly be useful, even if it is implemented as an add-on variable, for example .

The duplicates in the lighttable use the same input image (only the XMP file is different – it’s numbered).

1 Like

@PD1 you can rename the duplicate version to help differentiate which version you are looking at. I previously have suggested I wish I could do this with the snapshots I make so I can better different what each snapshot is showing me. But I didn’t get much traction with that suggestion.

image

Or you didn’t read the release notes :slight_smile: This is supported already, you can rename snapshots. Just ctrl+click on the snapshot button.

1 Like

Thanks Pascal. Despite reading the release notes for 4.6 I didn’t pick up on this change. It is a nice improvement. DT just keeps getting better. Thanks for all your work with DT as I really appreciate it. I try the weekly windows builds and look for the new features that pop up there, but some sneak past me.