There's legally usually quite a big gap between what pictures you can take of people, and how you can publish them.
In places where you don't have a reasonable expectation of privacy, you can generally be photographed. But there are significant limits to how such pictures can be published (including social media).
The law doesn't matter much if someone is convicted in the public square by intentionally misrepresented (or even just context-collapsed) images of them going viral to a global audience at Internet speed.
By the time the law, or the terms and conditions of social networks, catches up, the damage is already done.
This is a double edged sword. Two good events that should make us think about this are the Charlie Kirk funeral and the No Kings protest.
The former was a relatively small event broadcast live. The latter was a huge protest involving more people than the populations of some small countries. However, their media footprint was very different.
The No Kings protest produced no iconic visuals and was rapidly forgotten by international media. It had considerably less staying power than, say, the arab spring. Arguably because there existed no compelling visuals. It might as well have been a small protest of 100k people for the footprint it occupies in international consciousness.
The Charlie Kirk funeral, on the other hand, produced half a dozen memorable images that circulated for weeks.
In places where you don't have a reasonable expectation of privacy, you can generally be photographed. But there are significant limits to how such pictures can be published (including social media).