Camera make & model

Started by Nero, July 08, 2024, 06:56:01 AM

Previous topic - Next topic

Nero

I found a topic Replacing camera model information with user-defined abbreviations.

Is it possible to combine (part of) Make and Model that way?

I'm not familiar with Perl, only bash and Python for now.

nero@k95vj:~/seg$ exiftool -s -make -model P64/C730UZ/2003/05/witte\ tijger.JPG
Make                            : OLYMPUS OPTICAL CO.,LTD
Model                           : C730UZ
OS: Debian Bookworm LXDE
Exiftool ver: 12.57

StarGeek

It can be done with minor changes to that config.

]%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
MyModel => {
Require => {
0 => 'Model', # this will be $val[0]
1 => 'Make', # this will be $val[1]
},
ValueConv => q{
return 'CANON1' if ($val[0] =~ /^Canon PowerShot G1 X Mark III/ and $val[1] =~/something/);
return 'CANON2' if ($val[0] =~ /^Canon EOS 7D/ and $val[1] =~/something else/);
return 'PANA38' if ($val[0] =~ /^Panasonic DMC-FZ38/ and $val[1] =~/something differnt/);
return undef;
},
},
},
);
1;  #end

You would have to change the if conditions and the return value to your desired output.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Nero

Thank you for this solution.

But my goal is to get a generic solution to combine parts of both variables.
e.g. for the tags in the initial post i would like to obtain OLYMPUS_C730UZ, thus cut the make at the first space, joined with the model info.

Do I need to do that in the config file or is it possible inline in the exiftool command? I often use
${Model;s/[^a-zA-Z0-9]/_/g} to obtain the model of my Canon cameras. I guest this should be possible with the Make and Model combination too.
OS: Debian Bookworm LXDE
Exiftool ver: 12.57

StarGeek

Yes, it can be done inline with something like this
${Make;s/^([^ ]+).*/$1/}

This captures everything from the start of the line to the first space and removes everything else.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype