Adding tags to images in Windows 11

Sometimes when I am adding tags to images using the properties dialog of Windows explorer I get the following error:

error 0x88982F52: there is too much metadata...

This is frustrating as it means some of my photos cannot be tagged and I can't find an obvious reason for this. It has been happening across photos taken on different devices for years.

I came across this discussion on the problem. It turns out the problem is probably related to the size of thumbnail image that is stored in the metadata. The problem can be fixed by opening the image in the photos app, rotating it until it returns to it's original position and then closing the image. Not terribly elegant, but it does work!