I like that idea of converting metadata to text, so you can do text operations on it that you are already familiar with, and then apply the changes back.
If your problem can be solved by just regexps, there's a "rename" tool installed by Perl I've used for decades. E.g.
rename -n 's/JPEG$/jpg/' *JPEG
Will apply the substitution for JPEG at end of the filename to just jpg. The -n will run without renaming so you can see what it intends to do.
Note that the rename tool bundled with some distributions is not the Perl version. If someone is looking to install it, it may also be called perl-rename.
If your problem can be solved by just regexps, there's a "rename" tool installed by Perl I've used for decades. E.g.
Will apply the substitution for JPEG at end of the filename to just jpg. The -n will run without renaming so you can see what it intends to do.