Some scholars who are of the view that it is permissible and not haraam have stipulated conditions for that:
1-That the purpose of the picture should be permissible, such as for a passport, driver’s licence and so on.
2-The photographer should not introduce any changes or improvements to the picture.
3-It should not be a haraam picture such as a picture of a woman in makeup and the like.
It is clear that these conditions are not met in the case mentioned in the question. Thus it is clear that the action asked about here is haraam.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said:
With regard to these cameras which produce an image instantly, and the person has nothing to do with this image, we think that this does not come under the heading of image-making, rather it comes under the heading of transmitting an image that Allaah has made by means of this machine. This is like a reflection and the person has nothing to do with making the image. The ahaadeeth speak rather of image-making that is done by people in imitation of the creation of Allaah. This is like when a person writes a letter and makes a photocopy of it. The image that comes out is not what was done by the one who operated the machine; perhaps the one who operates the machine does not even know how to write. People will know that this was written by the first person, and that the second person had nothing to do with it. But if he makes this photographic image for a haraam purpose, then it is haraam because the means that lead to haraam ends are also haraam. End quote.
Majmoo’ Fataawa al-Shaykh al-‘Uthaymeen (2/question no. 318)
And Allaah knows best.