-
Notifications
You must be signed in to change notification settings - Fork 327
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
Batch edit of IPTC tags #6851
base: dev
Are you sure you want to change the base?
Batch edit of IPTC tags #6851
Conversation
Nice work!
For keywords and supplemental categories, a set mode could do a replacement, though I'm not sure how useful that would be. |
I had thought about this replacement functionality myself, but given that (a) I personally have never missed it, and (b) all the programs I know don't provide it, I thought it would be better to not unnecessarily complicate things. So I'd propose to leave it as it is (provided nobody finds any bugs, of course) for the time being. |
Hi there, for personal reasons, it's been quite a while since I last looked into RawTherapee (apart from using it for my pictures). Given that you seemed to like this proposal, I was a bit amazed to find that it neither made its way into the dev branch nor into the new releases. As I always emphasize, it is, of course, entirely up to you what you include into main RawTherapee, and what not. Still, may I ask for the reason? |
For me, it dropped off my radar after waiting for others to comment. Then there were higher priorities for 5.11 so I decided to leave it for 5.12 unless someone else reviewed it sooner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed your code uses tabs for indentation, but the surrounding code uses spaces. Could you change the tabs to spaces for consistency? GitHub shows the tabs with a width of 8 characters which makes your code look over-indented. I think your editor is set to display tabs with a width of 4.
Function-wise, this works perfectly.
// determine changes to IPTC tags of first selected picture | ||
originalParams = initialPP[0]; | ||
|
||
if (pparams.metadata.iptc[CAPTION].at(0).compare(originalParams.metadata.iptc[CAPTION].at(0)) != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if-else-if chain belongs in IPTCPanel::write
. The booleans like captionChangedFlag
can be placed in ParamsEdited
. The Glib::ustring
s like captionChanged
are not needed since they can be found in pparams
. The exceptions are the added/deleted keyword/category, which can also go in pparams
.
newParams = initialPP[i]; | ||
newParams = initialPP[i]; | ||
|
||
if (event == rtengine::EvIPTC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this block into ParamsEdited::combine
.
Hi, |
Hi there,
another proposal. As always, feel free to reject if you don't like it, or don't think it's suitable for general RawTherapee.
This adds the functionality to batch edit IPTC tags -- something that I was used to in Lightroom but missing from RawTherapee.
The fact that IPTC tags are, unlike other parameters, not individual values but contained in a single map, gave me some headache. For everything I have tested, my solution works, but it may well be that, for a more experienced RawTherapee developer, there would have been a better way to do this.
Logic is as follows:
This logic is, I believe, in line with the behavior one would expect, and with the way how batch editing works for other parameters. Since values are not numeric, the distinction between "add" and "replace" does not make sense; therefore, no changes to Preferences/Batch Processing.
Tested quite extensively for Linux, not for the other OS.
Side note: When working on this, I found that I needed some automatism for initializing all pictures before batch editing them (setting IPTC tags is usually the very first thing I do), since I kept forgetting to do it manually. Which was the reason for my "initialization" proposal some time ago. Thanks for your comments there; I'll look into that one again as soon as I find the time.