There is no general valid answer to that question. This is about the protection of a personal right, the so-called “right in one´s own picture”. If the circumstances ensure this right, consent must be given by the person (respectively all persons) on the photo.
According to § 78 UrhG, pictures of people may not be published if thereby “legitimate interests of the depicted person are infringed”. However, this term was not determined in greater detail by law, which is why there is a large number of individual decisions. First of all, it should ensure that everyone is protected against misuse of his/her depiction in public, especially in the form of public humiliation and degradation. Photos of persons may not be presented in a negative context. This can refer to the picture in connection with a certain text. The term “negative context” is interpreted widely. Already the possibility of a false interpretation is enough to infringe the legitimate interest of the depicted person and the publishing thereby becomes inadmissible. On the other hand, it is not up to the depicted person´s subjective feeling, but an objective standard must be applied. If no legitimate interest in the injunction can be recognised, there is no injunctive relief.
The delimitation whether there is injunctive relief due to legitimate interest is not defined in detail. This makes the assessment of the possible outcome of a procedure quite difficult and increases the financial risk for the litigants. A guideline could be to ask yourself whether there could be any objective reason why the person could be against the publishing in this concrete form.
Deviating regulations apply to public figures. As from May 2018, the reinforced regulations of the Data Protection New Act must be considered.
More on this topic: Data Protection Law