Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: exiv2 rename to allow all exiv2 tags #2238

Open
Saijin-Naib opened this issue May 17, 2022 · 3 comments · May be fixed by #2791
Open

Feature Request: exiv2 rename to allow all exiv2 tags #2238

Saijin-Naib opened this issue May 17, 2022 · 3 comments · May be fixed by #2791
Labels
request feature request or any other kind of wish

Comments

@Saijin-Naib
Copy link

Is your feature request related to a problem?

For many years on Windows I've been using ReNamer from den4b with exiv2 and some custom perl-scripting to make uniquely named photos an easy thing on my photo library. I use exiv2's rename functionality alongside inserting the Exif.Image.Model tag. The resultant filenames are like such:

2022-05-16 20.43.31 [Camera].extension
Describe the solution you would like

I would like the exiv2 rename function to accept any exiv2 tag. I'm not sure what the best syntax would be, or how it'd have to be "wrapped" to not be interpreted as a literal, but maybe something like this:

exiv2 rename -r ":Exif.Photo.DateTimeOriginal: [:Exif.Image.Model:]"
Describe alternatives you have considered

Due to lack of multilib support on my distro, I can not run ReNamer via WINE. I am not good with shell-scripting and I do not trust myself to write code that will safely mv/rename my images.

Additional context

FR was briefly discussed/asked intially on the exiv2 Matrix channel.

@Saijin-Naib Saijin-Naib added the request feature request or any other kind of wish label May 17, 2022
@postscript-dev
Copy link
Collaborator

@Saijin-Naib:
As you have found, currently the model name is unavailable for use when renaming with the Exiv2 application. The usual workaround is to write a script using exiv2 but this isn't an option here.

Instead, you could use the ExifTool command line program. The ExifTool manpage explains how to use the software, with the renaming examples being particularly useful for you. A complete list of all the tags supported by ExifTool is available here.

We can leave this FR open and hopefully at some point, the feature can be added to the Exiv2 application.

@norbertwg
Copy link
Contributor

I started to work on this issue. Here some details:

  • The syntax: the tag name has to be enclosed in colons. This is similar to using the existing placeholders like :basename:, so I think this will be very convenient.
  • The placeholder will be replaced by translated value, not by the plain value, as I think intention is to have a easy readable file name.
  • If the tag is not included in the image or the translated value is empty, a warning is printed.
  • Characters in tag's translated value, which are not allowed in file names, will be replaced by underscore. The characters to replace are: \\/:*?\"<>|. This list is valid for Windows. If on other supported operating systems (which I am not familiar with) additional characters need to be replaced, please let me know.

@Saijin-Naib Does this fit to your needs?

@Saijin-Naib
Copy link
Author

Yes, that's absolutely perfect! Thank you!

I think for Linux only the / is reserved, so your list looks great to me.

@norbertwg norbertwg linked a pull request Oct 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request feature request or any other kind of wish
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants