ExifTool Forum

ExifTool => Newbies => Topic started by: Piz Bernina on September 04, 2021, 04:42:34 PM

Title: Deleting Structures
Post by: Piz Bernina on September 04, 2021, 04:42:34 PM
Hi folks,

is there a way to delete a structure by only specifying a field name without the
value (e.g. using a placeholder for the value)?

I mean something like this (but it doesn't work):
exiftool -RegionExtensions-="{XMP-iptcExt:LocationShownSublocation=*}" test.xmp
The goal of this example is to remove all RegionExtension structures that contain a LocationShownSublocation field.

Any suggestions?
Title: Re: Deleting Structures
Post by: StarGeek on September 04, 2021, 05:00:14 PM
Are you talking about the MWG RegionExtensions (https://exiftool.org/TagNames/MWG.html#Extensions)?  If so, probably not.  Otherwise, Phil will have to respond and he's away for a couple of weeks.  You can hit the Notify button in the upper right corner of this thread to get a notification when there is a response.
Title: Re: Deleting Structures
Post by: Piz Bernina on September 05, 2021, 05:19:32 AM
@StarGeek: Thanks for your quick reply.

Yeah, I'm talking about MWG RegionExtensions. Why do you think, it's not possible to manipulate MWG RegionExtensions with placeholders (or something alike) but it may be possible with other kinds of structs?
Title: Re: Deleting Structures
Post by: StarGeek on September 05, 2021, 07:09:24 PM
Structures are very complicated to begin with and adding an arbitrary structure as would be done with the RegionExtensions increases that tremendously.  As it says in that link, RegionExtensions can only be written as full structures.

Though, giving it some further thought, it probably would be possible to do with user defined tag.  Internally, structures are Perl hashes and I would think that traversing the hash elements looking for the one you want to delete might be possible.  But that would be more of a hard coded solution.