Batch Processor: Export Original File Unmodified

Started by mosdubindi1, March 15, 2025, 03:05:02 PM

Previous topic - Next topic

mosdubindi1

Hello Mario,

According to my workflow I need to copy JPG file intact to another folder, rename file and modify only keywords.
For this I try to use option 'Export Original File Unmodified' in combination with 'Trim Metadata'. On the Metadata tab I select 'All Metadata including EXIF Camera Info' and use Custom Metadata variable to modify keywords.

The result is OK for keywords; however, some metadata are not copied correctly or not copied at all from source to output file.

Moreover, for different cameras, the result is different. For example, for Fujifilm GFX100S (see attached), tag {File.MD.Exif::Main\274\Orientation\0} changes from Rotate 270 CW in the source file to Horizontal (normal) in the output file, which leads Vertical file became Horizontal. Some tags filled in the source file are blank in the output. For Canon 5DS, problems are different, but also exist.

For me there is no need to try to fix all these inconsistencies, which occurs after recreation of metadata deleted by Trim, because there are lot of camera manufacturers and exifs. It would be better to have one more option 'Custom Metadata' on Format and Size tab, which could be activated in combination with 'Export Original File Unmodified'. This option will keep all metadata intact and activate Custom Metadata variable only. In this case metadata will not be recreated, only some focus metadata will be modified by Custom variable.

What do you think?

Thanks in advance,
Dmitry

Mario

#1
I'm not sure I follow.
The BP copies metadata with ExifTool, applying the settings you use. IMatch has no control over this. It just sends which tags/groups to copy to ExifTool and, if you have used those on top, your custom commands. That's it.

Maybe just don't trim metadata firsthand?
Trimming metadata and then just copying selected tags/groups is probably the reason for all of this, because it may trigger some automatic / magic things in ExifTool. I don't know about such things.

At least provide an example source images, all your settings in BP etc. so somebody can try to reproduce this.

mosdubindi1

If select 'Export Original File Unmodified' and don't Trim then Custom Metadata are not applied, and that is the problem. To solve it I suggest to add new option 'Custom Metadata', which will activate Custom metadata, while Trim is not active. I believe it could be helpful to target only metadata, which need to be changed, and do not worry about how ExifTool copy all tags/groups.

Mario

When the Trim option is is not enabled, a full copy of the original is made.
The "Copy Metadata" list is disabled in this case, and the Custom Metadata should also have been disabled.
I have corrected this for the next release.

mosdubindi1

Sorry Mario, I've tested this several times - if the Trim is not enabled, the 'Copy Metadata' list is disable including Custom Metadata. I need correction, but not the one you've mentioned. For me all ticks 'Copy Metadata' should remain disabled (like it is now), but Custom Metadata should be enabled, meaning if it is blank, then it is disabled, if there are some variables, then they should work. I believe it will give more flexibility, allowing to get a full copy (if section Custom Metadata = blank) or a copy with only modification mentioned in Custom Metadata.

Mario

Both are now disabled. Before the custom metadata was not disabled (but if trim is not enabled, no metadata is copied and no custom metadata is applied).

Image2.jpg

mosdubindi1

Still my problem is not solved. I need to flatten HierarchicalSubject in a full copy of original file. I was trying to achieve this by playing with different flags on 'Format and Size' and 'Metadata' tabs:

'Export Original File Unmodified' is enabled, the 'Trim' option is  disabled, then file size is full, metadata are OK, flatten cannot be done as soon as Custom Metadata is disabled (not good for me - problem with flattening). 

'Export Original File Unmodified' and 'Trim' are both enabled, then file size is full, flatten by Custom Metadata is OK, but some metadata are not correct due to strange recreation after trim (not good for me - problem with metadata).

'Export Original File Unmodified' is disabled, then metadata is OK, flatten by Custom Metadata is OK, but size is not OK (not good for me - need to  resize original file). 

From my point of view, the problem could be resolved by adding 3-rd option to Format and Size tab:
1st option: Export Original File Unmodified
2nd option: Trim Metadata
3rd option: Custom Metadata

In my case I would enable 1st and 3rd options, thus solving my problem.

If it is not good to modify BP from your perspective, could you please advise how to do step #3 in mass outside of BP?  

Custom Metadata used:
-hierarchicalsubject=
-subject=
{File.MD.subject|foreach:-HierarchicalSubject={value|splitlist:|,last}#;replace:#=={cr}{lf}}

thrinn

Quote from: mosdubindi1 on March 17, 2025, 05:22:11 PMIf it is not good to modify BP from your perspective, could you please advise how to do step #3 in mass outside of BP?  
Maybe you can use a two-step approach, combining a Batch Processor preset (to produce a modified copy of the files, including all metadata) with a Metadata Template to fill/overwrite the flattened keywords with your variable expression?

  • Use the Batch Processor with "Export original file unmodfied", but without "Trim metadata".
  • For the Metadata Template, you can create a Favorite.
  • A Favorite can be executed after the Batch Processor run:
2025-03-17 18_10_59-Image Batch Processor_ 'TEST'.jpg
Thorsten
Win 10 / 64, IMatch 2018, IMA

Mario

@thrinn: This probably does not work.

The output file produced by the BP must be in the database to be accessible for MD templates.
It might take IMatch a while to process files produced by the BP into the database, and it might not be "ready" when the BP runs the MD template.

Maybe:

1. Make a BP preset which does the copy, rename, distribute. Or, better, use the the Renamer when no metadata modification is required.
2. Run a MD template on the resulting files which flattens keywords or whatever is needed.



QuoteIf it is not good to modify BP from your perspective.
I don't intent to make the already complex metadata handling in the BP more complex for just one user. I'm happy that it runs well now. Thanks for reminding me to make the input field read-only.

Your workflow / requirements seem quite special, from the posts I've read so far.

Which is not a bad thing, but sometimes may require some extra steps - like running a Metadata Template or, if that does not work, run ExifTool directly via a External Tool favorite.

mosdubindi1

Thank you Mario for clear answer. Two-step approach is fine for me. The problem is that I cannot so far to reach the correct flattening of hierarchical keywords by using Metadata Template. When I'm using the same variable, the keywords are flattened, but instead of individual keywords IMatch understands the result as a single keyword, separated by comma. And I do not know how to break this keyword into individual keywords in mass for many files.

For example I use template with variable to flatten:
{File.MD.subject|foreach:{value|splitlist:|,last}#;replace:#==,}

The result is attached - hierarchical keywords are flattened, but with single keyword. The same result is if I use another template, which just copied flattened XMP into hierarchical keywords.

As you said run ExifTool directly most probably will produce correct result, but my knowledge is not enough to write instruction for  ExifTool.

Mario


mosdubindi1

Thank you very much Mario, finally my problem is solved. I use the template with variable {File.MD.subject|foreach:{value|splitlist:|,last}#;replace:#==~;} and it works.

Mario

If your flatten settings in IMatch don't match what you need in this case, this is a way to do it.
Or maybe switch IMatch to write only the leaf-level keyword when flattening keywords? Write hierarchical keywords?
Then {File.MD.subject} is already what you want.

mosdubindi1

Writing only the leaf-level keywords is not for my workflow as most of keywords within hierarchy I use as separate keywords. I've tested the two-step process with Metadata Template on some volume of files and it is working fine. Thank you for patience.