Question to translation of values of Composite-tags

Started by herb, August 09, 2020, 04:37:42 AM

Previous topic - Next topic

herb

Hello Phil,

Some days ago I got some images captured by a Panasonic TZ202 camera.
As a curious developer I looked into its metadata and so I came to the question of translation of composite tags.

With Exiftool 12.03 the German language file "de.pm" contains 7 PrintConv entries for Panasonic composite tag 'AdvancedSceneMode':
Because it does not contain
- a translated tag-description and
- a PrintConv value for 'Off'
the output for command
exiftool.exe -a -lang de -advancedscenemode test.jpg
is (of course)
Advanced Scene Mode             : Off

After adding a tag-description to 'AdvancedSceneMode' in de.pm file the output contains the German tag description:
Erweiteter Szenenmodus          : Off

But:
After adding the PrintConv value: 'Off' => 'Aus' to de.pm the value of 'AdvancedSceneMode' is printed unchanged as 'Off'.
I had expected it to be 'Aus'.


So my question is: Is it an error/problem/... in Exiftool in general or is it a problem with this special tag or ... ?

I made a similar observation with a user-defined composite tag in config file, which is in principal defined as follows
TestComposite => {
   ValueConv => q{
      return "testvalue"
   },
},


After adding tag-description and PrintConv value to language file de.pm the description has been translated, but the value remains un-translated.
Did I something wrong in defintion of my user-defined testtag?

Thanks for your help in advance.
Best regards
herb

Phil Harvey

Hi Herb,

Good question.  I'll look into this.

In general, for this to work you need a PrintConv in the original tag definition.  However, this doesn't seem to work for Composite tags.  I'll investigate.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Hmm.  This does work for Composite tags like Flash, so there must be something else going on here...

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Hi Herb,

Right.  AdvancedSceneMode is not a simple lookup.  The converted value is the result of a model-dependent calculation.  I hadn't been applying the language translations to conversions like this, but I will patch this in the next release so that it will work.

Thanks for pointing this out.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

thanks for the new version of Exiftool and thanks for the enhancement of Panasonic Composite-tag AdvancedSceneMode.

I opened this thread because I thought there is a general problem: how to translate Composite-tag values and my example tag for this was AdvancedSceneMode.

1) Composite-tag AdvancedSceneMode
You made a correction and enhanced the German language file. Thanks for this.
Now the values will be translatable. In case of 'Off' it works properly.
But I have observed an other thing: I got a TZ202 image with following metadata
---- MakerNotes:Panasonic ----
Shooting Mode                   : Intelligent Auto Plus
Advanced Scene Type             : 7
---- Composite ----
Advanced Scene Mode             : Intelligent Auto Plus (7)

with value not found in documented value-list.
Output without any print conversion shows:
---- MakerNotes:Panasonic ----
Shooting Mode                   : 60
Advanced Scene Type             : 7
---- Composite ----
Advanced Scene Mode             : DC-TZ202 60 7


Looking to the documented value-list I have the feeling that some/many values introduced with "newer" Panasonic cameras are unknown to Exiftool.
Might it be helpful to look for images made with various SceneModes?
I can try to ask a friend to capture images with his TZ202 camera.

2) Translation of Composite-tag values in general.
Can you please give an overview which prerequisites a user-defined composite tag must fulfill in order that
- its (string-) value can be translated e.g. into German and that
- in case of -n option the output will not be: HASH(0x...)


Thanks for your comments and help in advance.
Best regards
herb

Phil Harvey

Hi Herb,

Sure.  If you can figure out some of the unknown AdvancedSceneModes it would be great.

To be translatable, a user-defined tag must have a PrintConv that is a HASH lookup.

The Composite tag needs a ValueConv that returns a readable value, not a HASH reference.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

as said in my last post, I will try to get a list of AdvancedSceneMode values of a TZ202 camera.
This is still in work, but will take some more time.

Unexpected I could make such a list for a DMC-TZ5 camera. Please find list attached.
As the user-manual for TZ5 is for the following 4 cameras: TZ4, TZ5, TZ11 and TZ1, I guess that these cameras will all have identical tag-values.

Best regards
herb

herb

Hello Phil,

(1) some comments to my last post
I compared the values of my attached file with your value list (on internet page), because some looked to be strange.
We have repeated our test and the values in my list are correct;
Only value for Hi-Speed Burst needs to be corrected:
Hi-Speed Burst Schnelle Serie DMC-TZ5  27  1 36  1 26  1
   (captures 3 images)          image 1        image 2         image 3
26  1 27  1 36  1         only this line is correct


(2) attached please find also the values for images captured with a TZ202 camera.
There is one new value: Handheld Night Shot and
IntelligentAuto is: "60  7" instead of "37  5"

Best regards
herb

Phil Harvey

Hi Herb,

Thanks.  I'll add these new values.

It is unfortunate that the TZ5 (and other models you mention) changed some of the values.  I will add them, but only for the TZ5 for now.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

thanks for the enhancement in ExifTool 12.05 / 12.06.
My test has shown that it works almost properly for TZ5 and also TZ202 camera.

(1)
But I would like to suggest that the newly added lines ( I give only an example for Starry Sky )
'DMC-TZ5 30 1' => 'Starry Sky',
should be changed to
'30 1' => 'Starry Sky',
because than it is working also for TZ4, TZ11 and TZ15 camera and of course also for other cameras that write this values.

(2)
I found on error for TZ5: Fireworks is displayed as Snow. The following line is missing
'20 1' => 'Fireworks',

(3)
To value of Intelligent Auto I have a question:
Because for TZ202 the Intelligent Auto is flagged with '7' the following should be added:
return "$prt (intelligent auto)" if $v[1] == 7;

(4)
And then I have a question of understanding:
For translation e.g. into German the values must not be returned via return $prt. They must be read directly.

Thanks in advance and
Best regards
herb

Phil Harvey

Hi Herb,

Quote from: herb on September 14, 2020, 06:36:50 AM
(1)
But I would like to suggest that the newly added lines ( I give only an example for Starry Sky )
'DMC-TZ5 30 1' => 'Starry Sky',
should be changed to
'30 1' => 'Starry Sky',

Done.

Quote(2)
I found on error for TZ5: Fireworks is displayed as Snow. The following line is missing
'20 1' => 'Fireworks',

Added.

Quote(3)
To value of Intelligent Auto I have a question:
Because for TZ202 the Intelligent Auto is flagged with '7' the following should be added:
return "$prt (intelligent auto)" if $v[1] == 7;

Done.

Quote(4)
And then I have a question of understanding:
For translation e.g. into German the values must not be returned via return $prt. They must be read directly.

They can be returned via $prt, but the exact returned string must exist in the language translation table.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

Hello Phil,

thanks, that you will do all enhancements with next version.

Sorry, but I have again some changes.
All I said about "Intelligent Auto" of TZ202 was not detailed enough, because I did not know that this camera has 2 such modes, which a friend - he ownes this camera - explained to me yesterday:
- Intelligent Auto       -  flagged with 5
- Intelligent Auto Plus  -  flagged with 7

Therefore returning values should be as followes:
return "$prt (intelligent auto)" if $v[1] == 5;
return "$prt (intelligent auto plus)" if $v[1] == 7;


Sorry for the inconvenience
Best regards
herb

Phil Harvey

OK, I've changed this too and will release version 12.07 soon.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).