What is the earliest rabinical commentary referring to photography and what does it say? How has is been revised over the years? What of taking a photo on Shabbos? Is this ever permissible?
About 100 years ago Rabbi Elazar Greenwald in his Tshuvis Keren L’Dovid discusses someone who needed to be photographed on Shabbos for some government requirement. He states that photographing is certainly included in the melacha of Koseiv and is a Biblical prohibition. Nevertheless, this is for the one photographing, for posing for the picture taken by a non Jew, he finds leniency due to the extenuating circumstances.
The more common question today is walking in places where there are security cameras set up, and by walking there one will be photographed or videoed. Most poskim are of the opinion that when one is merely walking by and has no intent or gain from the camera there is no prohibition walking in such an area. See Shu”t Minchas Yitzchak 2:20, Shu”t Har Tzvi siman 230, and Shevet Halevi 1:121.